Share your code. Components are building blocks, you are the architect.

utils/map
v1.1.0
1.1.0
1.0.0
Takes a function and

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/map in your project
npm i @bit/bit.ramda.utils.map
Copied

map (fn:Function, list:Array) : Array

Takes a function and a functor, applies the function to each of the functor’s values, and returns a functor of the same shape.

Ramda provides suitable map implementations for Array and Object, so this function may be applied to [1, 2, 3] or {x: 1, y: 2, z: 3}.

Dispatches to the map method of the second argument, if present.

Acts as a transducer if a transformer is given in list position.

Also treats functions as functors and will compose them together.

Example

var double = x => x * 2;

     R.map(double, [1, 2, 3]); //=> [2, 4, 6]

     R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}

Arguments

fn: Function

The function to be called on every element of the input `list`.

list: Array

The list to be iterated over.

Returns

Array

The new list.