Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Generates a function that is called with initially supplied arguments
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.jshintrc
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

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
Something went wrong with that request. Please try again.