1 contributor
Like
Install chain as a package?
Copied
npm i @bit/justin-capalbo.ramda.chain
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
chain (
fn:
Function
,list:
) : Array
Array
chain
maps a function over a list and concatenates the results. chain
is also known as flatMap
in some libraries.
Dispatches to the chain
method of the second argument, if present,
according to the FantasyLand Chain spec.
If second argument is a function, chain(f, g)(x)
is equivalent to f(g(x), x)
.
Acts as a transducer if a transformer is given in list position.
Example
Arguments
fn:
Function
The function to map with
list:
Array
The list to map over
Returns
Array
The result of flat-mapping `list` with `fn`