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

utils/find
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns the first element of the list which matches the predicate, or

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

find (fn:Function, list:Array) : Object

Returns the first element of the list which matches the predicate, or undefined if no element matches.

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

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

Example

var xs = [{a: 1}, {a: 2}, {a: 3}];
     R.find(R.propEq('a', 2))(xs); //=> {a: 2}
     R.find(R.propEq('a', 4))(xs); //=> undefined

Arguments

fn: Function

The predicate function used to determine if the element is the desired one.

list: Array

The array to consider.

Returns

Object

The element found, or `undefined`.