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

utils/drop-while
v1.0.0
1.0.0
MIT
PUBLIC
0
Build: none
BuildNone
Returns a new list excluding the leading elements of a given list which

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

dropWhile (fn:Function, xs:Array) : Array

Returns a new list excluding the leading elements of a given list which satisfy the supplied predicate function. It passes each value to the supplied predicate function, skipping elements while the predicate function returns true. The predicate function is applied to one argument: (value).

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

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

Example

var lteTwo = x => x <= 2;

     R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]

     R.dropWhile(x => x !== 'd' , 'Ramda'); //=> 'da'

Arguments

fn: Function

The function called per iteration.

xs: Array

The collection to iterate over.

Returns

Array

A new array.