Table of Contents

Class MapToOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Extension methods implementing the mapTo operator.

public static class MapToOperator
Inheritance
System.Object
MapToOperator

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

source Observable<TSource>

The source sequence.

value TResult

The constant value to emit in place of every source value.

Returns

Observable<TResult>

An observable that emits value once for every value source emits.

Type Parameters

TSource

The type of values emitted by source.

TResult

The 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.