node-async-flow
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -14,3 +14,3 @@ | ||
cb.single = function(value) { | ||
return process.nextTick(() => { | ||
return process.nextTick(function() { | ||
instance.next(value); | ||
@@ -22,5 +22,5 @@ }); | ||
return function() { | ||
var params = Array.from(arguments); | ||
var params = Array.prototype.slice.call(arguments, 0); | ||
params.length = count; | ||
return process.nextTick(() => { | ||
return process.nextTick(function() { | ||
instance.next(params); | ||
@@ -36,5 +36,8 @@ }); | ||
return function() { | ||
var params = Array.prototype.slice.call(arguments, 0); | ||
var map = {}; | ||
keys.map((key, idx) => map[key] = arguments[idx]); | ||
return process.nextTick(() => { | ||
keys.map(function(key, idx) { | ||
map[key] = params[idx]; | ||
}); | ||
return process.nextTick(function() { | ||
instance.next(map); | ||
@@ -52,5 +55,2 @@ }); | ||
module.exports = Flow; | ||
Object.assign(module.exports, { | ||
util: require('./util') | ||
}); | ||
module.exports.util = require('./util'); |
const WaitUntil = (condition, timeout, cb) => { | ||
function WaitUntil(condition, timeout, cb) { | ||
@@ -8,3 +8,3 @@ const INTERVAL = Math.max(timeout / 100, 33); | ||
const wait = () => { | ||
function wait() { | ||
@@ -17,10 +17,8 @@ counter += INTERVAL; | ||
}; | ||
} | ||
setTimeout(wait, INTERVAL); | ||
}; | ||
} | ||
Object.assign(module.exports, { | ||
WaitUntil | ||
}); | ||
module.exports.WaitUntil = WaitUntil; |
{ | ||
"name": "node-async-flow", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
# node-async-flow | ||
An aggressive async flow solution for node.js 4.x+. | ||
An aggressive async flow solution for node.js. | ||
Generators are required. | ||
The support for Generator is required. | ||
Enable `--harmony-destructuring` and `--harmony-rest-parameters` if necessary. | ||
Also works with `babel` with `babel-polyfill` enabled. | ||
## Why? | ||
@@ -12,0 +8,0 @@ |
5619
51
105