-
Notifications
You must be signed in to change notification settings - Fork 191
Open
Description
For our project we would like to use SSE. Currently, code to activate SSE for LiveReload 3.0.0 is quite simple:
if (LiveReload) {
LiveReload.connector.disconnect();
}
var source = new EventSource(url);
source.addEventListener ('reload', function (evt) {
var files;
try { files = JSON.parse (evt.data); } catch (e) { return; }
if (LiveReload) {
files.forEach (function (file) {
LiveReload.performReload ({path: file})
});
} else {
location.reload ();
}
});
source.addEventListener ('alert', function (evt) {
console.log ('alert event', evt);
if (LiveReload) {
LiveReload.performAlert (evt.data);
}
});
Unfortunately, this not works with minified version nor version 3.0.1. I would like to make it works without LiveReload.connector.disconnect()
if that's fine for you
Metadata
Metadata
Assignees
Labels
No labels