Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/Andarist/callbag-pairwise
- Owner: Andarist
- Created: 2018-03-24T20:43:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-02T15:19:12.000Z (over 6 years ago)
- Last Synced: 2024-10-24T00:26:09.513Z (20 days ago)
- Topics: callbag, callbags
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-callbags - pairwise
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)
}),
)
```