Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
/ partial Public archive

⚠️ this project is not longer maintained - Partial application of arguments to function

License

Notifications You must be signed in to change notification settings

Nexxa/partial

Repository files navigation

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

About

⚠️ this project is not longer maintained - Partial application of arguments to function

Resources

License

Stars

Watchers

Forks

Packages

No packages published