This package has been deprecated

Author message:

Package no longer supported. Use at your own risk.

nexxa-partial

1.0.1 • Public • Published

partial Build Status

Partial application of arguments to function.

API

partial(fn[, arg1[, arg2[, ...]]])

Parameters

  • fn - {Function}
    The function

  • arg1, arg2, ... - {*}
    Partially applied arguments

Returns

{Function} - The function with supplied arguments partially applied

Example

function sum(x, y) {
  return x + y;
}

const sum1 = partial(sum, 1);

sum(1, 2); // 3
sum1(2);   // 3
sum1(4);   // 5

Contribution

Fork the repo and send pull requests.

npm test to run tests, npm run lint to run eslint

Package Sidebar

Install

npm i nexxa-partial

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • stefano_magrassi