From f7f57a5f4387d454dd5409e924e48fc140af79f4 Mon Sep 17 00:00:00 2001 From: Ahmed Zamil Date: Thu, 16 Jan 2020 03:52:55 +0300 Subject: [PATCH] TriggerChunk --- package.json | 2 +- src/Core/AsyncReply.js | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 649eca0..c188c1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "esyur", - "version": "1.3.8", + "version": "1.3.9", "description": "Distributed Object Framework", "main": "esyur.js", "scripts": { diff --git a/src/Core/AsyncReply.js b/src/Core/AsyncReply.js index 5cf72b7..5ed53a4 100644 --- a/src/Core/AsyncReply.js +++ b/src/Core/AsyncReply.js @@ -87,6 +87,9 @@ export default class AsyncReply extends Promise trigger(result) { + if (this.ready) + return; + this.result = result; this.ready = true; @@ -114,18 +117,12 @@ export default class AsyncReply extends Promise triggerProgress(type, value, max) { - if (this.ready) - return; - for(var i = 0; i < this.progressCallbacks.length; i++) this.progressCallbacks[i](type, value, max, this); } triggerChunk(value) { - if (this.ready) - return; - for(var i = 0; i < this.chunkCallbacks.length; i++) this.chunkCallbacks[i](value, this); }