Comparing version 0.1.0 to 0.2.0
@@ -5,3 +5,3 @@ var Fiforce = module.exports = function () { | ||
var flush = function () { | ||
while (queue[0] && queue[0].completed) { | ||
while (queue[0] && queue[0].call) { | ||
queue.shift().call(); | ||
@@ -12,10 +12,3 @@ } | ||
return function (callback) { | ||
var callbackObject = { | ||
completed: false, | ||
arguments: [], | ||
callback: callback, | ||
call: function () { | ||
callback.apply(null, this.arguments); | ||
} | ||
}; | ||
var callbackObject = {}; | ||
@@ -25,4 +18,7 @@ queue.push(callbackObject); | ||
return function () { | ||
callbackObject.completed = true; | ||
callbackObject.arguments = arguments; | ||
var args = arguments; | ||
callbackObject.call = function () { | ||
callback.apply(null, args); | ||
}; | ||
flush(); | ||
@@ -29,0 +25,0 @@ }; |
{ | ||
"name": "fiforce", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Ensure FIFO ordering of asynchronous calls", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
3219
5
0
20