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

utils/pluck
v1.0.0
1.0.0
MIT
PUBLIC
0
1     DEPENDENCIES
Build: none
BuildNone
Returns a new list by plucking the same named property off all objects in

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/pluck in your project
npm i @bit/bit.ramda.utils.pluck
Copied

pluck (key:(Number | String), f:Array) : Array

Returns a new list by plucking the same named property off all objects in the list supplied.

pluck will work on any functor in addition to arrays, as it is equivalent to R.map(R.prop(k), f).

Example

R.pluck('a')([{a: 1}, {a: 2}]); //=> [1, 2]
     R.pluck(0)([[1, 2], [3, 4]]);   //=> [1, 3]
     R.pluck('val', {a: {val: 3}, b: {val: 5}}); //=> {a: 3, b: 5}

Arguments

key: (Number | String)

The key name to pluck off of each object.

f: Array

The array or functor to consider.

Returns

Array

The list of values for the given key.