2
0
mirror of https://github.com/esiur/esiur-js.git synced 2025-05-06 12:32:58 +00:00

TriggerChunk

This commit is contained in:
Ahmed Zamil 2020-01-16 03:52:55 +03:00
parent 4606993bf1
commit f7f57a5f43
2 changed files with 4 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "esyur", "name": "esyur",
"version": "1.3.8", "version": "1.3.9",
"description": "Distributed Object Framework", "description": "Distributed Object Framework",
"main": "esyur.js", "main": "esyur.js",
"scripts": { "scripts": {

View File

@ -87,6 +87,9 @@ export default class AsyncReply extends Promise
trigger(result) trigger(result)
{ {
if (this.ready)
return;
this.result = result; this.result = result;
this.ready = true; this.ready = true;
@ -114,18 +117,12 @@ export default class AsyncReply extends Promise
triggerProgress(type, value, max) triggerProgress(type, value, max)
{ {
if (this.ready)
return;
for(var i = 0; i < this.progressCallbacks.length; i++) for(var i = 0; i < this.progressCallbacks.length; i++)
this.progressCallbacks[i](type, value, max, this); this.progressCallbacks[i](type, value, max, this);
} }
triggerChunk(value) triggerChunk(value)
{ {
if (this.ready)
return;
for(var i = 0; i < this.chunkCallbacks.length; i++) for(var i = 0; i < this.chunkCallbacks.length; i++)
this.chunkCallbacks[i](value, this); this.chunkCallbacks[i](value, this);
} }