Skip to content

Andarist/callbag-distinct-until-changed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 log 1 2 3 4
    console.log(value)
  }),
)

Alternatives

About

👜 Callbag operator that drops consecutive duplicate values

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors