0.0.1 • Published 10 years ago

callback-with v0.0.1

Weekly downloads
147
License
MIT
Repository
github
Last release
10 years ago

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