callbag-pairwise

1.0.1 • Public • Published

callbag-pairwise

Emits the previous and current values as an array

Example

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

Package Sidebar

Install

npm i callbag-pairwise

Weekly Downloads

44

Version

1.0.1

License

MIT

Unpacked Size

2.98 kB

Total Files

4

Last publish

Collaborators

  • andarist