Table of Contents

Class SkipWhileOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Implements the SkipWhile operator. Mirrors rxjs's skipWhile.

public static class SkipWhileOperator
Inheritance
System.Object
SkipWhileOperator

Methods

SkipWhile<T>(Observable<T>, Func<T, bool>)

Skips values from source for as long as predicate returns true, then emits that value and every value after it, unchanged.

public static Observable<T> SkipWhile<T>(this Observable<T> source, Func<T, bool> predicate)

Parameters

source Observable<T>

The source observable to skip values from.

predicate Func<T, bool>

A function that tests each value while skipping is still in effect.

Returns

Observable<T>

An observable that starts emitting once predicate first returns false.

Type Parameters

T

The element type of the source observable.

Remarks

Equivalent to the indexed overload with the index ignored. If predicate throws, the exception is forwarded via OnError.

SkipWhile<T>(Observable<T>, Func<T, int, bool>)

Skips values from source for as long as predicate, called with the value and its zero-based emission index, returns true, then emits that value and every value after it, unchanged.

public static Observable<T> SkipWhile<T>(this Observable<T> source, Func<T, int, bool> predicate)

Parameters

source Observable<T>

The source observable to skip values from.

predicate Func<T, int, bool>

A function that tests each value together with its index, while skipping is still in effect.

Returns

Observable<T>

An observable that starts emitting once predicate first returns false.

Type Parameters

T

The element type of the source observable.

Remarks

Once predicate has returned false for the first time, it is never invoked again for the rest of the subscription — this is a "sticky" transition, matching rxjs's skipWhile exactly. If predicate throws, the exception is forwarded via OnError.