skip
Last updated
Last updated
skip(the: Number): Observable
skip
?Skip allows you to ignore the first x emissions from the source. Generally skip
is used when you have an observable that always emits certain values on subscription that you wish to ignore. Perhaps those first few aren't needed or you are subscribing to a Replay
or BehaviorSubject
and do not need to act on the initial values. Reach for skip
if you are only concerned about later emissions.
You could mimic skip
by using filter
with indexes. Ex. .filter((val, index) => index > 1)
Example 1: Skipping values before emission
( StackBlitz | jsBin | jsFiddle )
( StackBlitz | jsBin | jsFiddle )
skip 📰 - Official docs
Filtering operator: take, first, skip 🎥 💵 - André Staltz
📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/skip.ts