callbag-cut

1.0.0 • Public • Published

callbag-cut

Mod of callbag buffer. Emits the buffered values until the separator emits a value, "cutting" the source.

Example

import cut from 'callbag-cut'
import forEach from 'callbag-for-each'
import fromEvent from 'callbag-from-event'
import map from 'callbag-map'
import pipe from 'callbag-pipe'
 
const btn = document.getElementById('#release')
 
pipe(
  fromEvent(document, 'click'),
  map(() => Math.floor(Math.random() * 100))
  cut(fromEvent(btn, 'click')),
  forEach(values => {
    console.log(values) // [86], [86, 93], [86, 93, 57], [], [64] ...
  })
)

Dependents (0)

Package Sidebar

Install

npm i callbag-cut

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.94 kB

Total Files

6

Last publish

Collaborators

  • petyosi