We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dd7a1d commit d6434acCopy full SHA for d6434ac
src/EventSource.js
@@ -262,13 +262,15 @@ class EventSource {
262
}
263
264
close() {
265
- this.status = this.CLOSED;
+ if (this.status !== this.CLOSED) {
266
+ this.status = this.CLOSED;
267
+ this.dispatch('close', { type: 'close' });
268
+ }
269
+
270
clearTimeout(this._pollTimer);
271
if (this._xhr) {
272
this._xhr.abort();
273
-
- this.dispatch('close', { type: 'close' });
274
275
276
0 commit comments