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

utils/find-index
v1.1.0
1.1.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns the index of the first element of the list which matches the

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

findIndex (fn:Function, list:Array) : Number

Returns the index of the first element of the list which matches the predicate, or -1 if no element matches.

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

Example

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

Arguments

fn: Function

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

list: Array

The array to consider.

Returns

Number

The index of the element found, or `-1`.