callbag-drop-after

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i callbag-drop-after

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.51 kB

Total Files

4

Last publish

Collaborators

  • andarist