callbag-distinct-until-changed

1.0.0 • Public • Published

callbag-distinct-until-changed

Drops consecutive duplicate values. Works on either pullable or listenable sources.

Uses strict (===) comparison by default, but it accepts a custom comparator function too.

Example

import distinctUntilChanged from 'callbag-distinct-until-changed'
import forEach from 'callbag-for-each'
import fromIterable from 'callbag-from-iter'
import pipe from 'callbag-pipe'
 
pipe(
  fromIterable([1, 1, 2, 2, 3, 3, 4, 4]),
  distinctUntilChanged(),
  forEach(value => {
    // will 1 2 3 4
    console.log(value)
  }),
)

Package Sidebar

Install

npm i callbag-distinct-until-changed

Weekly Downloads

47

Version

1.0.0

License

MIT

Unpacked Size

3.62 kB

Total Files

4

Last publish

Collaborators

  • andarist