Table of Contents

Class MinOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Extension methods implementing the min operator.

public static class MinOperator
Inheritance
System.Object
MinOperator

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

source Observable<T>

The source sequence.

Returns

Observable<T>

An observable that emits the smallest value seen, once source completes.

Type Parameters

T

The type of values emitted by source and 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

source Observable<T>

The source sequence.

comparer Func<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 source completes.

Type Parameters

T

The type of values emitted by source and 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.