embark-area-51/lib/modules/code_generator/code/reload-on-change.js

7 lines
183 B
JavaScript

const ws = new WebSocket(`ws://${location.hostname}:${location.port}`);
ws.addEventListener('message', (evt) => {
if(evt.data === 'outputDone') {
location.reload(true);
}
});