1.1.0 • Published 6 years ago

callbag-with-previous v1.1.0

Weekly downloads
60
License
MIT
Repository
github
Last release
6 years ago

callbag-with-previous

Callbag operator that puts the previous value alongside the current in an array.

[currentValue, previousValue]

The first output will also have true as a third item, to allow you to distinguish from the previous item being undefined and the first value.

[firstValue, undefined, true]

npm install callbag-with-previous

example

const fromIter = require('callbag-from-iter');
const forEach = require('callbag-for-each');
const withPrevious = require('callbag-with-previous');

const source = withPrevious(fromIter([1,2,3]));

forEach(x => console.log(x))(source); // [1, undefined, true]
                                      // [2, 1]
                                      // [3, 2]
1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago