traverse

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
3 KB
Maps an [Applicative](https://github
1 contributor
Install traverse as a package?
Copied
npm i @bit/justin-capalbo.ramda.traverse
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
traverse (
of:Function,
f:Function,
traversable:*
) : *

Maps an Applicative-returning function over a Traversable, then uses sequence to transform the resulting Traversable of Applicative into an Applicative of Traversable.

Dispatches to the traverse method of the third argument, if present.

Example
// Returns `Maybe.Nothing` if the given divisor is `0`
     const safeDiv = n => d => d === 0 ? Maybe.Nothing() : Maybe.Just(n / d)

     R.traverse(Maybe.of, safeDiv(10), [2, 4, 5]); //=> Maybe.Just([5, 2.5, 2])
     R.traverse(Maybe.of, safeDiv(10), [2, 0, 5]); //=> Maybe.Nothing
Arguments
of: Function
f: Function
traversable: *
Returns
*

Help and resources