root / HServer / 00.Server / 00.Program / node_modules / lodash / flow.js
이력 | 보기 | 이력해설 | 다운로드 (666 Bytes)
1 | 39 | HKM | var createFlow = require('./_createFlow'); |
---|---|---|---|
2 | |||
3 | /**
|
||
4 | * Creates a function that returns the result of invoking the given functions
|
||
5 | * with the `this` binding of the created function, where each successive
|
||
6 | * invocation is supplied the return value of the previous.
|
||
7 | *
|
||
8 | * @static
|
||
9 | * @memberOf _
|
||
10 | * @since 3.0.0
|
||
11 | * @category Util
|
||
12 | * @param {...(Function|Function[])} [funcs] The functions to invoke.
|
||
13 | * @returns {Function} Returns the new composite function.
|
||
14 | * @see _.flowRight
|
||
15 | * @example
|
||
16 | *
|
||
17 | * function square(n) {
|
||
18 | * return n * n;
|
||
19 | * }
|
||
20 | *
|
||
21 | * var addSquare = _.flow([_.add, square]);
|
||
22 | * addSquare(1, 2);
|
||
23 | * // => 9
|
||
24 | */
|
||
25 | var flow = createFlow();
|
||
26 | |||
27 | module.exports = flow; |