1.0.0 • Published 6 years ago

callbag-buffer-time v1.0.0

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

callbag-buffer-time

Callbag operator which buffers source values until provided time has passed.

Example

import bufferTime from 'callbag-buffer-time'
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))
  bufferTime(5000),
  forEach(values => {
    console.log(values) // [86, 93, 57, 64] ...
  })
)