How to use the traverse function from ramda

Find comprehensive JavaScript ramda.traverse code examples handpicked from public code repositorys.

7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
* @category List
* @sig (Applicative f, Traversable t) => (a -> f a) -> t (f a) -> f (t a)
* @param {Function} of
* @param {*} traversable
* @return {*}
* @see R.traverse
* @example
*
*      R.sequence(Maybe.of, [Just(1), Just(2), Just(3)]);   //=> Just([1, 2, 3])
*      R.sequence(Maybe.of, [Just(1), Just(2), Nothing()]); //=> Nothing()
fork icon0
star icon0
watch icon0

+ 53 other calls in file

13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
 *
 *      // 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
 */




var traverse =
fork icon0
star icon0
watch icon2

+ 11 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)