Class MapToOperator
Extension methods implementing the mapTo operator.
public static class MapToOperator
- Inheritance
-
System.ObjectMapToOperator
Methods
MapTo<TSource, TResult>(Observable<TSource>, TResult)
Emits value every time source emits, ignoring the actual source
value. Equivalent to source.Map(_ => value). Errors and completion are passed through unchanged.
public static Observable<TResult> MapTo<TSource, TResult>(this Observable<TSource> source, TResult value)
Parameters
sourceObservable<TSource>The source sequence.
valueTResultThe constant value to emit in place of every source value.
Returns
- Observable<TResult>
An observable that emits
valueonce for every valuesourceemits.
Type Parameters
TSourceThe type of values emitted by
source.TResultThe type of
value.
Remarks
Marked @deprecated upstream (in favor of map(() => value)) but still present in rxjs 7.8.2, so it is ported here too.