currify

2018-10-23 admin

currify是什么

什么是currify,translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments

currify使用教程帮助文档

Currify License NPM version Dependency Status Build Status

Translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments.

Install

npm i currify --save

How to use?

const currify = require('currify');
const mean = (a, b, c) => (a + b) / c;
const mean1 = currify(mean, 1);
const mean2 = mean1(2);
mean2(2);
// returns
1.5

Environments

In old node.js environments that not fully supports es2015, currify could be used with:

var currify = require('currify/legacy');

Related

  • fullstore - functional variables.

  • zames - converts callback-based functions to Promises and apply currying to arguments

  • wraptile - translate the evaluation of a function that takes multiple arguments into evaluating a sequence of 2 functions, each with a any count of arguments.

License

MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-43448.html

文章标题:currify

回到顶部