Skip to main content

Overview

Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.

Type Signature

function skipUntil<T>(notifier: ObservableInput<any>): MonoTypeOperatorFunction<T>

Parameters

notifier
ObservableInput<any>
required
An ObservableInput that has to emit an item before the source Observable elements begin to be mirrored by the resulting Observable.

Returns

MonoTypeOperatorFunction<T> - A function that returns an Observable that skips items from the source Observable until the notifier Observable emits an item.

Usage Examples

Basic Example

import { interval, fromEvent, skipUntil } from 'rxjs';

const intervalObservable = interval(1000);
const click = fromEvent(document, 'click');

const emitAfterClick = intervalObservable.pipe(
  skipUntil(click)
);

emitAfterClick.subscribe(value => console.log(value));
// Starts emitting after first click
  • skip - Skips first N values
  • skipLast - Skips last N values
  • skipWhile - Skips while condition is true
  • takeUntil - Takes values until another Observable emits