An xstream operator that groups consecutive events into N-tuples
npm install xstream-tuplewisexstream-tuplewise!npm
An xstream operator that groups consecutive events into N-tuples
``typescript`
function tuplewise
Note that xstream is a peer dependencies of this library, which need to be installed separately.
``
$ npm install xstream-tuplewise
``
$ yarn add xstream-tuplewise
``
---0---1-------2-------3-----------4--------|
tuplewise(0)
[]-[]--[]------[]------[]----------[]-------|
``
---0---1-------2-------3-----------4--------|
tuplewise(1)
---[0]-[1]-----[2]-----[3]---------[4]------|
``
---0---1-------2-------3-----------4--------|
tuplewise(2)
-------[0,1]---[1,2]---[2,3]-------[3,4]----|
```
---0---1-------2-------3-----------4--------|
tuplewise(3)
---------------[0,1,2]-[1,2,3]-----[2,3,4]--|
MIT