landau / callback-with

Generates a function that is called with initially supplied arguments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

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

About

Generates a function that is called with initially supplied arguments

License:MIT License


Languages

Language:JavaScript 100.0%