callback-with

0.0.1 • Public • Published

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

Package Sidebar

Install

npm i callback-with

Weekly Downloads

320

Version

0.0.1

License

MIT

Last publish

Collaborators

  • landau