callbag-pairwise
Version:
👜 Callbag operator that emits the previous and current values as an array.
22 lines (17 loc) • 392 B
Markdown
Emits the previous and current values as an array
```js
import forEach from 'callbag-for-each'
import fromIterable from 'callbag-from-iter'
import pairwise from 'pairwise'
import pipe from 'callbag-pipe'
pipe(
fromIterable([1, 2, 3, 4, 5]),
pairwise,
forEach(value => {
// will log [1, 2], [2, 3], [3, 4], [4, 5]
console.log(value)
}),
)
```