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

utils/drop-repeats-with
v1.1.0
1.1.0
1.0.0
Returns a new list without any consecutively repeating elements

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

dropRepeatsWith (pred:Function, list:Array) : Array

Returns a new list without any consecutively repeating elements. Equality is determined by applying the supplied predicate to each pair of consecutive elements. The first element in a series of equal elements will be preserved.

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

Example

var l = [1, -1, 1, 3, 4, -4, -4, -5, 5, 3, 3];
     R.dropRepeatsWith(R.eqBy(Math.abs), l); //=> [1, 3, 4, -5, 3]

Arguments

pred: Function

A predicate used to test whether two items are equal.

list: Array

The array to consider.

Returns

Array

`list` without repeating elements.