Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Andarist/callbag-pairwise

👜 Callbag operator that groups pairs of consecutive emissions together and emits them as an array of two values.
https://github.com/Andarist/callbag-pairwise

callbag callbags

Last synced: 18 days ago
JSON representation

👜 Callbag operator that groups pairs of consecutive emissions together and emits them as an array of two values.

Awesome Lists containing this project

README

        

# callbag-pairwise

Emits the previous and current values as an array

## Example

```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)
}),
)
```