1.0.0 • Published 6 years ago

callbag-distinct-until-changed v1.0.0

Weekly downloads
506
License
MIT
Repository
github
Last release
6 years ago

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)
  }),
)