reconnecting-eventsource 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
var ReconnectingEventSource=function(e){var t={};function n(r){if(t[r])return t[r].exports;var
|
|
1
|
+
var ReconnectingEventSource=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r,o,i;o=[e,n(1)],void 0===(i="function"==typeof(r=function(e,t){"use strict";var n,r=(n=t)&&n.__esModule?n:{default:n};e.exports=r.default})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){var r,o,i;o=[t],void 0===(i="function"==typeof(r=function(e){"use strict";function t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=e.EventSourceNotAvailableError=function(e){function t(){return r(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"EventSource not available.\nConsider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor."))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}(),i=function(){function e(t,n){var i=this;if(r(this,e),this._configuration=null!=n?Object.assign({},n):null,this._eventSource=null,this._lastEventId=null,this._timer=null,this._listeners={},this.url=t,this.readyState=0,this.max_retry_time=3e3,this.eventSourceClass=globalThis.EventSource,null!=this._configuration&&(this._configuration.lastEventId&&(this._lastEventId=this._configuration.lastEventId,delete this._configuration.lastEventId),this._configuration.max_retry_time&&(this.max_retry_time=this._configuration.max_retry_time,delete this._configuration.max_retry_time),this._configuration.eventSourceClass&&(this.eventSourceClass=this._configuration.eventSourceClass,delete this._configuration.eventSourceClass)),null==this.eventSourceClass||"function"!=typeof this.eventSourceClass)throw new o;this._onevent_wrapped=function(e){i._onevent(e)},this._start()}return n(e,[{key:"_start",value:function(){var e=this,t=this.url;this._lastEventId&&(-1===t.indexOf("?")?t+="?":t+="&",t+="lastEventId="+encodeURIComponent(this._lastEventId)),this._eventSource=new this.eventSourceClass(t,this._configuration),this._eventSource.onopen=function(t){e._onopen(t)},this._eventSource.onerror=function(t){e._onerror(t)},this._eventSource.onmessage=function(t){e.onmessage(t)};var n=!0,r=!1,o=void 0;try{for(var i,s=Object.keys(this._listeners)[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var a=i.value;this._eventSource.addEventListener(a,this._onevent_wrapped)}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}},{key:"_onopen",value:function(e){0===this.readyState&&(this.readyState=1,this.onopen(e))}},{key:"_onerror",value:function(e){var t=this;if(1===this.readyState&&(this.readyState=0,this.onerror(e)),this._eventSource&&2===this._eventSource.readyState){this._eventSource.close(),this._eventSource=null;var n=Math.round(this.max_retry_time*Math.random());this._timer=setTimeout((function(){return t._start()}),n)}}},{key:"_onevent",value:function(e){e.lastEventId&&(this._lastEventId=e.lastEventId);var n=this._listeners[e.type];if(null!=n)for(var r=[].concat(t(n)),o=0;o<r.length;o++)(0,r[o])(e);"message"===e.type&&this.onmessage(e)}},{key:"onopen",value:function(e){}},{key:"onerror",value:function(e){}},{key:"onmessage",value:function(e){}},{key:"close",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._eventSource&&(this._eventSource.close(),this._eventSource=null),this.readyState=2}},{key:"addEventListener",value:function(e,n){var r=e.toString();r in this._listeners||(this._listeners[r]=[],this._eventSource&&this._eventSource.addEventListener(r,this._onevent_wrapped));var o=this._listeners[r];o.includes(n)||(this._listeners[r]=[].concat(t(o),[n]))}},{key:"removeEventListener",value:function(e,t){var n=e.toString();if(n in this._listeners){var r=this._listeners[n].filter((function(e){return e!==t}));r.length>0?this._listeners[n]=r:(delete this._listeners[n],this._eventSource&&this._eventSource.removeEventListener(n,this._onevent_wrapped))}}}]),e}();e.default=i})?r.apply(t,o):r)||(e.exports=i)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ReconnectingEventSource=function(e){var t={};function n(r){if(t[r])return t[r].exports;var
|
|
1
|
+
var ReconnectingEventSource=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r,o,i;o=[e,n(1)],void 0===(i="function"==typeof(r=function(e,t){"use strict";var n,r=(n=t)&&n.__esModule?n:{default:n};e.exports=r.default})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){var r,o,i;o=[t],void 0===(i="function"==typeof(r=function(e){"use strict";function t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=e.EventSourceNotAvailableError=function(e){function t(){return r(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"EventSource not available.\nConsider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor."))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}(),i=function(){function e(t,n){var i=this;if(r(this,e),this._configuration=null!=n?Object.assign({},n):null,this._eventSource=null,this._lastEventId=null,this._timer=null,this._listeners={},this.url=t,this.readyState=0,this.max_retry_time=3e3,this.eventSourceClass=globalThis.EventSource,null!=this._configuration&&(this._configuration.lastEventId&&(this._lastEventId=this._configuration.lastEventId,delete this._configuration.lastEventId),this._configuration.max_retry_time&&(this.max_retry_time=this._configuration.max_retry_time,delete this._configuration.max_retry_time),this._configuration.eventSourceClass&&(this.eventSourceClass=this._configuration.eventSourceClass,delete this._configuration.eventSourceClass)),null==this.eventSourceClass||"function"!=typeof this.eventSourceClass)throw new o;this._onevent_wrapped=function(e){i._onevent(e)},this._start()}return n(e,[{key:"_start",value:function(){var e=this,t=this.url;this._lastEventId&&(-1===t.indexOf("?")?t+="?":t+="&",t+="lastEventId="+encodeURIComponent(this._lastEventId)),this._eventSource=new this.eventSourceClass(t,this._configuration),this._eventSource.onopen=function(t){e._onopen(t)},this._eventSource.onerror=function(t){e._onerror(t)},this._eventSource.onmessage=function(t){e.onmessage(t)};var n=!0,r=!1,o=void 0;try{for(var i,s=Object.keys(this._listeners)[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var a=i.value;this._eventSource.addEventListener(a,this._onevent_wrapped)}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}},{key:"_onopen",value:function(e){0===this.readyState&&(this.readyState=1,this.onopen(e))}},{key:"_onerror",value:function(e){var t=this;if(1===this.readyState&&(this.readyState=0,this.onerror(e)),this._eventSource&&2===this._eventSource.readyState){this._eventSource.close(),this._eventSource=null;var n=Math.round(this.max_retry_time*Math.random());this._timer=setTimeout((function(){return t._start()}),n)}}},{key:"_onevent",value:function(e){e.lastEventId&&(this._lastEventId=e.lastEventId);var n=this._listeners[e.type];if(null!=n)for(var r=[].concat(t(n)),o=0;o<r.length;o++)(0,r[o])(e);"message"===e.type&&this.onmessage(e)}},{key:"onopen",value:function(e){}},{key:"onerror",value:function(e){}},{key:"onmessage",value:function(e){}},{key:"close",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._eventSource&&(this._eventSource.close(),this._eventSource=null),this.readyState=2}},{key:"addEventListener",value:function(e,n){var r=e.toString();r in this._listeners||(this._listeners[r]=[],this._eventSource&&this._eventSource.addEventListener(r,this._onevent_wrapped));var o=this._listeners[r];o.includes(n)||(this._listeners[r]=[].concat(t(o),[n]))}},{key:"removeEventListener",value:function(e,t){var n=e.toString();if(n in this._listeners){var r=this._listeners[n].filter((function(e){return e!==t}));r.length>0?this._listeners[n]=r:(delete this._listeners[n],this._eventSource&&this._eventSource.removeEventListener(n,this._onevent_wrapped))}}}]),e}();e.default=i})?r.apply(t,o):r)||(e.exports=i)}]);
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(1),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var
|
|
1
|
+
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(1),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=t.EventSourceNotAvailableError=function(e){function t(){return o(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"EventSource not available.\nConsider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor."))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}(),u=function(){function e(t,n){var r=this;if(o(this,e),this._configuration=null!=n?Object.assign({},n):null,this._eventSource=null,this._lastEventId=null,this._timer=null,this._listeners={},this.url=t,this.readyState=0,this.max_retry_time=3e3,this.eventSourceClass=globalThis.EventSource,null!=this._configuration&&(this._configuration.lastEventId&&(this._lastEventId=this._configuration.lastEventId,delete this._configuration.lastEventId),this._configuration.max_retry_time&&(this.max_retry_time=this._configuration.max_retry_time,delete this._configuration.max_retry_time),this._configuration.eventSourceClass&&(this.eventSourceClass=this._configuration.eventSourceClass,delete this._configuration.eventSourceClass)),null==this.eventSourceClass||"function"!=typeof this.eventSourceClass)throw new s;this._onevent_wrapped=function(e){r._onevent(e)},this._start()}return r(e,[{key:"_start",value:function(){var e=this,t=this.url;this._lastEventId&&(-1===t.indexOf("?")?t+="?":t+="&",t+="lastEventId="+encodeURIComponent(this._lastEventId)),this._eventSource=new this.eventSourceClass(t,this._configuration),this._eventSource.onopen=function(t){e._onopen(t)},this._eventSource.onerror=function(t){e._onerror(t)},this._eventSource.onmessage=function(t){e.onmessage(t)};var n=!0,r=!1,i=void 0;try{for(var o,s=Object.keys(this._listeners)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;this._eventSource.addEventListener(u,this._onevent_wrapped)}}catch(e){r=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw i}}}},{key:"_onopen",value:function(e){0===this.readyState&&(this.readyState=1,this.onopen(e))}},{key:"_onerror",value:function(e){var t=this;if(1===this.readyState&&(this.readyState=0,this.onerror(e)),this._eventSource&&2===this._eventSource.readyState){this._eventSource.close(),this._eventSource=null;var n=Math.round(this.max_retry_time*Math.random());this._timer=setTimeout((function(){return t._start()}),n)}}},{key:"_onevent",value:function(e){e.lastEventId&&(this._lastEventId=e.lastEventId);var t=this._listeners[e.type];if(null!=t)for(var n=[].concat(i(t)),r=0;r<n.length;r++){(0,n[r])(e)}"message"===e.type&&this.onmessage(e)}},{key:"onopen",value:function(e){}},{key:"onerror",value:function(e){}},{key:"onmessage",value:function(e){}},{key:"close",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._eventSource&&(this._eventSource.close(),this._eventSource=null),this.readyState=2}},{key:"addEventListener",value:function(e,t){var n=e.toString();n in this._listeners||(this._listeners[n]=[],this._eventSource&&this._eventSource.addEventListener(n,this._onevent_wrapped));var r=this._listeners[n];r.includes(t)||(this._listeners[n]=[].concat(i(r),[t]))}},{key:"removeEventListener",value:function(e,t){var n=e.toString();if(n in this._listeners){var r=this._listeners[n].filter((function(e){return e!==t}));r.length>0?this._listeners[n]=r:(delete this._listeners[n],this._eventSource&&this._eventSource.removeEventListener(n,this._onevent_wrapped))}}}]),e}();t.default=u}]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reconnecting-eventsource",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "wrapper library around the JavaScript EventSource API to ensure it maintains a connection to the server.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "reconnecting-eventsource.d.ts",
|
|
@@ -53,5 +53,8 @@
|
|
|
53
53
|
"stoppable": "^1.1.0",
|
|
54
54
|
"webpack": "^4.41.2",
|
|
55
55
|
"webpack-cli": "^3.3.10"
|
|
56
|
+
},
|
|
57
|
+
"engines" : {
|
|
58
|
+
"node" : ">=12.0.0"
|
|
56
59
|
}
|
|
57
60
|
}
|
|
@@ -2,6 +2,7 @@ export interface ReconnectableEventSourceInit extends EventSourceInit {
|
|
|
2
2
|
// the maximum time to wait before attempting to reconnect in ms, default `3000`
|
|
3
3
|
// note: wait time is randomised to prevent all clients from attempting to reconnect simultaneously
|
|
4
4
|
max_retry_time?: number;
|
|
5
|
+
eventSourceClass?: any;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export default class ReconnectingEventSource extends EventSource {
|
|
@@ -20,6 +20,16 @@
|
|
|
20
20
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
21
21
|
// IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
+
export class EventSourceNotAvailableError extends Error {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(
|
|
26
|
+
'EventSource not available.\n' +
|
|
27
|
+
'Consider loading an EventSource polyfill and making it available globally as EventSource, ' +
|
|
28
|
+
'or passing one in as eventSourceClass to the ReconnectingEventSource constructor.'
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
23
33
|
export default class ReconnectingEventSource {
|
|
24
34
|
|
|
25
35
|
constructor(url, configuration) {
|
|
@@ -33,7 +43,7 @@ export default class ReconnectingEventSource {
|
|
|
33
43
|
this.url = url;
|
|
34
44
|
this.readyState = 0;
|
|
35
45
|
this.max_retry_time = 3000;
|
|
36
|
-
this.eventSourceClass = EventSource;
|
|
46
|
+
this.eventSourceClass = globalThis.EventSource;
|
|
37
47
|
|
|
38
48
|
if (this._configuration != null) {
|
|
39
49
|
if (this._configuration.lastEventId) {
|
|
@@ -52,6 +62,10 @@ export default class ReconnectingEventSource {
|
|
|
52
62
|
}
|
|
53
63
|
}
|
|
54
64
|
|
|
65
|
+
if(this.eventSourceClass == null || typeof this.eventSourceClass !== 'function') {
|
|
66
|
+
throw new EventSourceNotAvailableError();
|
|
67
|
+
}
|
|
68
|
+
|
|
55
69
|
this._onevent_wrapped = event => { this._onevent(event); };
|
|
56
70
|
|
|
57
71
|
this._start();
|