Class TakeLastOperator
Implements the TakeLast operator. Mirrors rxjs's takeLast.
public static class TakeLastOperator
- Inheritance
-
System.ObjectTakeLastOperator
Methods
TakeLast<T>(Observable<T>, int)
Buffers up to the last count values from source, emitting all of
them, in the order they were received, only once source completes.
public static Observable<T> TakeLast<T>(this Observable<T> source, int count)
Parameters
sourceObservable<T>The source observable to buffer values from.
countintThe maximum number of trailing values to emit.
Returns
- Observable<T>
An observable that emits at most the last
countvalues fromsource, all at once, once it completes. Ifcountis zero or less, an empty, already-completed observable is returned andsourceis never subscribed to.
Type Parameters
TThe element type of the source observable.
Remarks
If source emits fewer than count values before completing, all of
them are emitted. Because nothing is emitted until source completes, using
TakeLast<T>(Observable<T>, int) with a source that never completes results in an
observable that never emits anything.