To use the flow
function from the lodash
library in TypeScript, you need to install the @types/lodash
type definition package:
index.ts37 chars2 lines
Then, you can import the flow
function and use it in your TypeScript code like this:
index.ts369 chars17 lines
The flow
function takes an array of functions and returns a new function that is the composition of those functions, with the output of each function being passed as input to the next one. In the example above, the mulitplyAndAdd
function first multiplies its inputs by 1 and 2, then adds them together, resulting in 5
.
gistlibby LogSnag