skip

function stable

Returns an Observable that skips the first count items emitted by the source Observable.

skip<T>(count: number): MonoTypeOperatorFunction<T>

Parameters

count

The number of times, items emitted by source Observable should be skipped.

Returns

MonoTypeOperatorFunction<T>: A function that returns an Observable that skips the first count values emitted by the source Observable.

Description

skip marble diagram

Skips the values until the sent notifications are equal or less than provided skip count. It raises an error if skip count is equal or more than the actual number of emits and source raises an error.

Example

Skip the values before the emission

import { interval } from 'rxjs';
import { skip } from 'rxjs/operators';

//emit every half second
const source = interval(500);
//skip the first 10 emitted values
const example = source.pipe(skip(10));
//output: 10...11...12...13........
const subscribe = example.subscribe(val => console.log(val));

See Also

© 2015–2021 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/api/operators/skip