Table of Contents

Class MapOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

Extension methods implementing the map operator.

public static class MapOperator
Inheritance
System.Object
MapOperator

Methods

Map<TSource, TResult>(Observable<TSource>, Func<TSource, int, TResult>)

Applies project to each value emitted by source, along with the zero-based index of that emission, and emits the resulting value in its place. Errors and completion are passed through unchanged.

public static Observable<TResult> Map<TSource, TResult>(this Observable<TSource> source, Func<TSource, int, TResult> project)

Parameters

source Observable<TSource>

The source sequence.

project Func<TSource, int, TResult>

A transform function applied to each source value and its index (starting at 0).

Returns

Observable<TResult>

An observable of the projected values.

Type Parameters

TSource

The type of values emitted by source.

TResult

The type of values produced by project.

Remarks

If project throws, the exception is forwarded to the subscriber via OnError instead of propagating synchronously out of Subscribe.

Map<TSource, TResult>(Observable<TSource>, Func<TSource, TResult>)

Applies project to each value emitted by source and emits the resulting value in its place. Errors and completion are passed through unchanged.

public static Observable<TResult> Map<TSource, TResult>(this Observable<TSource> source, Func<TSource, TResult> project)

Parameters

source Observable<TSource>

The source sequence.

project Func<TSource, TResult>

A transform function applied to each source value.

Returns

Observable<TResult>

An observable of the projected values.

Type Parameters

TSource

The type of values emitted by source.

TResult

The type of values produced by project.

Remarks

If project throws, the exception is forwarded to the subscriber via OnError instead of propagating synchronously out of Subscribe.