From 2736a3db9dfe9b9e3276d0f1d99818177c002734 Mon Sep 17 00:00:00 2001 From: NI Date: Thu, 19 Sep 2019 14:59:02 +0800 Subject: [PATCH] Clean up ui/stream/subscribe.js --- ui/stream/subscribe.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/stream/subscribe.js b/ui/stream/subscribe.js index b09fe1f..3391079 100644 --- a/ui/stream/subscribe.js +++ b/ui/stream/subscribe.js @@ -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]); } /**