You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to propose the inner, curried function take dynamic args as well:
async.constant=_restParam(function(values){varargs=[null].concat(values);return_restParam(function(callbackArgs){// <= We only care about the callback,varcallback=callbackArgs.pop();// and assume it's the last argreturncallback.apply(this,args);// when the curried function is invoked});});
Why do I care?
Composability. I don't want to care about the callback-signature of other functions in Async-chains.
async.waterfall([doSomething/*(cb)*/,//=> Invokes cb with (err, arg1, arg2)async.constant('Pretend doSomething did somethingElse')/*(arg1, arg2, cb)*/],doneCb);
The text was updated successfully, but these errors were encountered:
In
v1.5.2
constant seems to be hard-coded to be invoked with 1 arg: a callback. This is limitingI'd like to propose the inner, curried function take dynamic args as well:
Why do I care?
Composability. I don't want to care about the callback-signature of other functions in Async-chains.
The text was updated successfully, but these errors were encountered: