UNPKG

722 BJavaScriptView Raw
1var _curry1 =
2/*#__PURE__*/
3require("./internal/_curry1");
4/**
5 * Returns a function that always returns the given value. Note that for
6 * non-primitives the value returned is a reference to the original value.
7 *
8 * This function is known as `const`, `constant`, or `K` (for K combinator) in
9 * other languages and libraries.
10 *
11 * @func
12 * @memberOf R
13 * @since v0.1.0
14 * @category Function
15 * @sig a -> (* -> a)
16 * @param {*} val The value to wrap in a function
17 * @return {Function} A Function :: * -> val.
18 * @example
19 *
20 * const t = R.always('Tee');
21 * t(); //=> 'Tee'
22 */
23
24
25var always =
26/*#__PURE__*/
27_curry1(function always(val) {
28 return function () {
29 return val;
30 };
31});
32
33module.exports = always;
\No newline at end of file