Skip to content
Permalink
Browse files

Fix 'error' callback

  • Loading branch information...
mythz committed Jul 9, 2019
1 parent 1851087 commit 50e2cad96937b8698458e71c259db5ae6f46974b
Showing with 4 additions and 4 deletions.
  1. +1 −1 dist/index.js
  2. +1 −1 dist/servicestack-client.min.js
  3. +1 −1 dist/servicestack-client.umd.js
  4. +1 −1 src/index.ts
@@ -264,7 +264,7 @@ var ServerEventsClient = /** @class */ (function () {
var es = this.EventSource
? new this.EventSource(url, this.getEventSourceOptions())
: new EventSource(url, this.getEventSourceOptions());
es.addEventListener('error', function (e) { return opt.onerror || hold.onerror || _this.onError; });
es.addEventListener('error', function (e) { return (opt.onerror || hold.onerror || _this.onError)(e); });
es.addEventListener('message', opt.onmessage || hold.onmessage || this.onMessage);
var fn = this.options.onReconnect;
if (fn != null)

Large diffs are not rendered by default.

@@ -274,7 +274,7 @@ var __assign = (this && this.__assign) || Object.assign || function(t) {
var es = this.EventSource
? new this.EventSource(url, this.getEventSourceOptions())
: new EventSource(url, this.getEventSourceOptions());
es.addEventListener('error', function (e) { return opt.onerror || hold.onerror || _this.onError; });
es.addEventListener('error', function (e) { return (opt.onerror || hold.onerror || _this.onError)(e); });
es.addEventListener('message', opt.onmessage || hold.onmessage || this.onMessage);
var fn = this.options.onReconnect;
if (fn != null)
@@ -386,7 +386,7 @@ export class ServerEventsClient {
const es = this.EventSource
? new this.EventSource(url, this.getEventSourceOptions())
: new EventSource(url, this.getEventSourceOptions());
es.addEventListener('error', e => opt.onerror || hold.onerror || this.onError);
es.addEventListener('error', e => (opt.onerror || hold.onerror || this.onError)(e));
es.addEventListener('message', opt.onmessage || hold.onmessage || this.onMessage);

var fn = this.options.onReconnect;

0 comments on commit 50e2cad

Please sign in to comment.
You can’t perform that action at this time.