https://github.com/andarist/callbag-time-interval
👜 Callbag operator which emits the value with time elapsed since last emission.
https://github.com/andarist/callbag-time-interval
callbag callbags
Last synced: 6 months ago
JSON representation
👜 Callbag operator which emits the value with time elapsed since last emission.
- Host: GitHub
- URL: https://github.com/andarist/callbag-time-interval
- Owner: Andarist
- Created: 2018-11-07T21:18:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-11T23:57:11.000Z (almost 7 years ago)
- Last Synced: 2024-10-30T03:39:41.897Z (12 months ago)
- Topics: callbag, callbags
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# callbag-time-interval
Callbag operator which emits the value with time elapsed since last emission.
## Example
```js
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)
}),
)
```