Table of Contents

Class TakeOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Extension methods implementing the take operator.

public static class TakeOperator
Inheritance
System.Object
TakeOperator

Methods

Take<T>(Observable<T>, int)

Emits only the first count values from source, then completes and unsubscribes from source — regardless of whether source itself ever completes. If source emits fewer than count values, all of them are emitted and the output completes whenever source does.

public static Observable<T> Take<T>(this Observable<T> source, int count)

Parameters

source Observable<T>

The source sequence.

count int

The maximum number of values to emit.

Returns

Observable<T>

An observable that emits at most count values from source. If count is zero or less, an empty, already-completed observable is returned and source is never subscribed to.

Type Parameters

T

The type of values emitted by source.