1.0.0 • Published 6 years ago

callbag-time-interval v1.0.0

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

callbag-time-interval

Callbag operator which emits the value with time elapsed since last emission.

Example

import forEach from 'callbag-for-each'
import pipe from 'callbag-pipe'
import take from 'callbag-take'
import timer from 'callbag-timer'
import timeInterval from 'callbag-time-interval'

pipe(
  timer(100, 1000),
  timeInterval,
  take(5),
  forEach(value => {
    // will log:
    // [100, 0]
    // [1000, 1]
    // [1000, 2]
    // [1000, 3]
    // [1000, 4]
    console.log(value)
  }),
)
1.0.0

6 years ago