callbag-buffer-time

1.0.0 • Public • Published

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] ...
  })
)

Readme

Keywords

Package Sidebar

Install

npm i callbag-buffer-time

Weekly Downloads

14

Version

1.0.0

License

MIT

Unpacked Size

2.58 kB

Total Files

4

Last publish

Collaborators

  • andarist