,--1,System.Func{--1,--0,--1})} ,System.Func{--0,--0,--0})}
Observable.Scan(IObservable, TAccumulate, Func) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<TAccumulate> Scan<TSource, TAccumulate>(this IObservable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator) - 2.
public static IObservable<TSource> Scan<TSource>(this IObservable<TSource> source, Func<TSource, TSource, TSource> accumulator)
1. Overload¶
public static IObservable<TAccumulate> Scan<TSource, TAccumulate>(this IObservable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator)
Summary: Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. For aggregation behavior with no intermediate results, see Aggregate.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TAccumulate | The type of the result of the aggregation. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence to accumulate over. |
seed | TAccumulate | The initial accumulator value. |
accumulator | Func | An accumulator function to be invoked on each element. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or accumulator is null. |
2. Overload¶
public static IObservable<TSource> Scan<TSource>(this IObservable<TSource> source, Func<TSource, TSource, TSource> accumulator)
Summary: Applies an accumulator function over an observable sequence and returns each intermediate result. For aggregation behavior with no intermediate results, see Aggregate.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence and the result of the aggregation. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence to accumulate over. |
accumulator | Func | An accumulator function to be invoked on each element. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or accumulator is null. |