1.0.0 • Published 6 years ago

callbag-drop-after v1.0.0

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

callbag-drop-after

Callbag operator that drops all events after the first event for which predicate returns true.

Inspired by most.js's skipAfter.

Example

import dropAfter from 'callbag-drop-after'
import forEach from 'callbag-for-each'
import fromIter from 'callbag-from-iter'
import pipe from 'callbag-pipe'

pipe(
  fromIter([10, 20, 30, 40, 50, 60, 70]),
  dropAfter(value => value >= 30),
  forEach(value => {
    // will log 10, 20, 30
    console.log(value)
  }),
)
1.0.0

6 years ago