promise-stream-queue
Advanced tools
Comparing version 0.4.2 to 0.4.3
30
item.js
@@ -34,4 +34,4 @@ function Item(id,pr,timeout) { | ||
this.then = function(cbsuccess,cberror) { | ||
if(cbsuccess) onsuccess.unshift(cbsuccess); | ||
if(cberror) onerror.unshift(cberror); | ||
if(cbsuccess) onsuccess.push(cbsuccess); | ||
if(cberror) onerror.push(cberror); | ||
checkNotify(); | ||
@@ -42,3 +42,3 @@ return this; | ||
this.catch = function(cbcatch) { | ||
if(cbcatch) oncatch.unshift(cbcatch); | ||
if(cbcatch) oncatch.push(cbcatch); | ||
checkNotify(); | ||
@@ -51,5 +51,7 @@ return this; | ||
set("resolve",data); | ||
while(onsuccess.length) { | ||
onsuccess.pop()(data); | ||
let len = onsuccess.length; | ||
for(let i=0;i<len;i++) { | ||
onsuccess[i](data); | ||
} | ||
onsuccess = []; | ||
} | ||
@@ -60,5 +62,7 @@ | ||
set("reject",error); | ||
while(onerror.length) { | ||
onerror.pop()(error); | ||
let len = onerror.length; | ||
for(let i=0;i<len;i++) { | ||
onerror[i](error); | ||
} | ||
onerror = []; | ||
} | ||
@@ -69,5 +73,7 @@ | ||
set("catch",error); | ||
while(oncatch.length) { | ||
oncatch.pop()(error); | ||
let len = oncatch.length; | ||
for(let i=0;i<len;i++) { | ||
oncatch[i](error); | ||
} | ||
oncatch = []; | ||
} | ||
@@ -77,5 +83,7 @@ | ||
set("killed",error); | ||
while(onerror.length) { | ||
onerror.pop()(error); | ||
let len = onerror.length; | ||
for(let i=0;i<len;i++) { | ||
onerror[i](error); | ||
} | ||
onerror = []; | ||
} | ||
@@ -82,0 +90,0 @@ |
{ | ||
"name": "promise-stream-queue", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Promise Stream. Queue promises and retrieve the resolved/rejected ones in the inserted order", | ||
@@ -5,0 +5,0 @@ "author": "David Gómez Matarrodona <solzimer@gmail.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19871
487