main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
595 bytes
|
Line | |
---|
1 | import _curry2 from "./internal/_curry2.js";
|
---|
2 | /**
|
---|
3 | * Takes a value and applies a function to it.
|
---|
4 | *
|
---|
5 | * This function is also known as the `thrush` combinator.
|
---|
6 | *
|
---|
7 | * @func
|
---|
8 | * @memberOf R
|
---|
9 | * @since v0.25.0
|
---|
10 | * @category Function
|
---|
11 | * @sig a -> (a -> b) -> b
|
---|
12 | * @param {*} x The value
|
---|
13 | * @param {Function} f The function to apply
|
---|
14 | * @return {*} The result of applying `f` to `x`
|
---|
15 | * @example
|
---|
16 | *
|
---|
17 | * const t42 = R.applyTo(42);
|
---|
18 | * t42(R.identity); //=> 42
|
---|
19 | * t42(R.add(1)); //=> 43
|
---|
20 | */
|
---|
21 |
|
---|
22 | var applyTo =
|
---|
23 | /*#__PURE__*/
|
---|
24 | _curry2(function applyTo(x, f) {
|
---|
25 | return f(x);
|
---|
26 | });
|
---|
27 |
|
---|
28 | export default applyTo; |
---|
Note:
See
TracBrowser
for help on using the repository browser.