0.0.1 • Published 10 years ago
callback-with v0.0.1
callback-with
Generates a function that is called with initially supplied arguments.
install
npm i -S callback-with
Usage
// async version
var fn = callbackWith('foo');
fn(function (foo) {
assert(foo === 'foo'); // true
});
// sync version can return values
var fn = callbackWith.sync('foo');
var bar = fn(function (foo) {
assert(foo === 'foo'); // true
return 'bar';
});
assert(bar === 'bar'); // true
0.0.1
10 years ago