This method is like `flow` except that it composes a function that invokes the given functions from right to left.
function square(n) {
return n * n
}
const addSquare = flowRight([square, add])
addSquare(1, 2)
// => 9
Name | Type | Attribute | Description |
---|---|---|---|
funcs | The functions to invoke. |
{ "comment": "/**\r\n * This method is like `flow` except that it composes a function that\r\n * invokes the given functions from right to left.\r\n *\r\n * @since 3.0.0\r\n * @category Util\r\n * @param {Function[]} [funcs] The functions to invoke.\r\n * @returns {Function} Returns the new composite function.\r\n * @see flow\r\n * @example\r\n *\r\n * function square(n) {\r\n * return n * n\r\n * }\r\n *\r\n * const addSquare = flowRight([square, add])\r\n * addSquare(1, 2)\r\n * // => 9\r\n */", "meta": { "range": [ 486, 548 ], "filename": "flowRight.js", "lineno": 22, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100002872", "name": "flowRight", "type": "FunctionDeclaration", "paramnames": [ "funcs" ] } }, "description": "This method is like `flow` except that it composes a function that\rinvokes the given functions from right to left.", "since": "3.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Util", "value": "Util" } ], "params": [ { "type": { "names": [ "Array." ] }, "optional": true, "description": "The functions to invoke.", "name": "funcs" } ], "returns": [ { "type": { "names": [ "function" ] }, "description": "Returns the new composite function." } ], "see": [ "flow" ], "examples": [ "function square(n) {\r return n * n\r}\r\rconst addSquare = flowRight([square, add])\raddSquare(1, 2)\r// => 9" ], "name": "flowRight", "longname": "flowRight", "kind": "function", "scope": "global", "___id": "T000002R000307", "___s": true, "filepath": "flowRight.js" }