Class TakeOperator
Extension methods implementing the take operator.
public static class TakeOperator
- Inheritance
-
System.ObjectTakeOperator
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
sourceObservable<T>The source sequence.
countintThe maximum number of values to emit.
Returns
- Observable<T>
An observable that emits at most
countvalues fromsource. Ifcountis zero or less, an empty, already-completed observable is returned andsourceis never subscribed to.
Type Parameters
TThe type of values emitted by
source.