This commit is contained in:
Dawid Dziurla 2020-03-26 15:37:35 +01:00
parent d9becc67b6
commit 9308795b8b
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B
964 changed files with 104265 additions and 16 deletions

33
node_modules/ramda/es/thunkify.js generated vendored Normal file
View file

@ -0,0 +1,33 @@
import curryN from "./curryN.js";
import _curry1 from "./internal/_curry1.js";
/**
* Creates a thunk out of a function. A thunk delays a calculation until
* its result is needed, providing lazy evaluation of arguments.
*
* @func
* @memberOf R
* @since v0.26.0
* @category Function
* @sig ((a, b, ..., j) -> k) -> (a, b, ..., j) -> (() -> k)
* @param {Function} fn A function to wrap in a thunk
* @return {Function} Expects arguments for `fn` and returns a new function
* that, when called, applies those arguments to `fn`.
* @see R.partial, R.partialRight
* @example
*
* R.thunkify(R.identity)(42)(); //=> 42
* R.thunkify((a, b) => a + b)(25, 17)(); //=> 42
*/
var thunkify =
/*#__PURE__*/
_curry1(function thunkify(fn) {
return curryN(fn.length, function createThunk() {
var fnArgs = arguments;
return function invokeThunk() {
return fn.apply(this, fnArgs);
};
});
});
export default thunkify;