Clean up ui/stream/subscribe.js

This commit is contained in:
NI
2019-09-19 14:59:02 +08:00
parent a074586dcb
commit 2736a3db9d

View File

@@ -47,13 +47,13 @@ export class Subscribe {
* @param {any} d Resolve data which will be send to the subscriber
*/
resolve(d) {
if (this.res === null) {
this.pending.push([typeResolve, d]);
if (this.res !== null) {
this.res(d);
return;
}
this.res(d);
this.pending.push([typeResolve, d]);
}
/**
@@ -63,13 +63,13 @@ export class Subscribe {
*
*/
reject(e) {
if (this.rej === null) {
this.pending.push([typeReject, e]);
if (this.rej !== null) {
this.rej(e);
return;
}
this.rej(e);
this.pending.push([typeReject, e]);
}
/**