Class MinOperator
Extension methods implementing the min operator.
public static class MinOperator
- Inheritance
-
System.ObjectMinOperator
Remarks
Built directly on the no-seed Reduce<T>(Observable<T>, Func<T, T, T>) overload,
matching rxjs's own min.ts (itself a thin wrapper over reduce). Since that overload emits nothing
for an empty source rather than erroring, so does Min<T>(Observable<T>) — matches rxjs exactly, verified
against the 7.8.2 tag rather than assumed.
Methods
Min<T>(Observable<T>)
Emits the single smallest value seen from source, once it completes, using the
default Comparer<T> for T.
public static Observable<T> Min<T>(this Observable<T> source)
Parameters
sourceObservable<T>The source sequence.
Returns
- Observable<T>
An observable that emits the smallest value seen, once
sourcecompletes.
Type Parameters
TThe type of values emitted by
sourceand of the output.
Remarks
If source completes without ever emitting, the output completes without emitting any value either.
Min<T>(Observable<T>, Func<T, T, int>)
Emits the single smallest value seen from source (per comparer),
once it completes.
public static Observable<T> Min<T>(this Observable<T> source, Func<T, T, int> comparer)
Parameters
sourceObservable<T>The source sequence.
comparerFunc<T, T, int>A function returning a negative number if the first value is smaller, matching Comparer<T>.Compare(T, T)'s contract.
Returns
- Observable<T>
An observable that emits the smallest value seen, once
sourcecompletes.
Type Parameters
TThe type of values emitted by
sourceand of the output.
Remarks
If source completes without ever emitting, the output completes without emitting any
value either. If comparer throws, the exception is forwarded via OnError.