cs
callbag-skip
npm i callbag-skip
cs

callbag-skip

👜 Callbag operator that skips the first N data points of a source

by André Staltz

1.1.0 (see all)License:MITTypeScript:DefinitelyTyped
npm i callbag-skip
Readme

callbag-skip

Callbag operator that skips the first N data points of a source. Works on either pullable and listenable sources.

npm install callbag-skip

example

On a listenable source:

const interval = require('callbag-interval');
const observe = require('callbag-observe');
const skip = require('callbag-skip');

const source = skip(3)(interval(1000));

source(0, observe(x => console.log(x))); // 3
                                         // 4
                                         // 5
                                         // 6
                     // ...

On a pullable source:

const fromIter = require('callbag-from-iter');
const iterate = require('callbag-iterate');
const skip = require('callbag-skip');

function* range(from, to) {
  let i = from;
  while (i <= to) {
    yield i;
    i++;
  }
}

const source = skip(4)(fromIter(range(10, 20)));

source(0, iterate(x => console.log(x))); // 14
                                         // 15
                                         // 16
                                         // 17
                                         // 18
                                         // 19
                                         // 20

Downloads/wk

1.1K

GitHub Stars

3

LAST COMMIT

9mos ago

MAINTAINERS

2

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

1
VersionTagPublished
1.1.0
latest
4yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate