callback-with

Generates a function that is called with initially supplied arguments

callback-with

Generates a function that is called with initially supplied arguments.

npm i -S callback-with

// 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