,--1,System.Func{--1,--0,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask{--1}})} ,--1,System.Func{--1,--0,--1})}
ObservableAsync.Scan(IObservableAsync, TAcc, Func>) method¶
Defined in
Type: ObservableAsync
Namespace: ReactiveUI.Extensions.Async
Assembly: ReactiveUI.Extensions.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Overloads¶
- 1.
public static IObservableAsync<TAcc> Scan<T, TAcc>(this IObservableAsync<T> @this, TAcc seed, Func<TAcc, T, CancellationToken, ValueTask<TAcc>> accumulator) - 2.
public static IObservableAsync<TAcc> Scan<T, TAcc>(this IObservableAsync<T> @this, TAcc seed, Func<TAcc, T, TAcc> accumulator)
1. Overload¶
public static IObservableAsync<TAcc> Scan<T, TAcc>(this IObservableAsync<T> @this, TAcc seed, Func<TAcc, T, CancellationToken, ValueTask<TAcc>> accumulator)
Summary: Applies an accumulator function over the observable sequence and returns each intermediate result using the specified asynchronous accumulator.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements in the source sequence. |
TAcc | The type of the accumulated value. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
seed | TAcc | The initial accumulator value. |
accumulator | Func | An asynchronous accumulator function to be invoked on each element. Receives the current accumulator value, the current element, and a cancellation token. |
Returns: IObservableAsync
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if accumulator is null. |
2. Overload¶
public static IObservableAsync<TAcc> Scan<T, TAcc>(this IObservableAsync<T> @this, TAcc seed, Func<TAcc, T, TAcc> accumulator)
Summary: Applies an accumulator function over the observable sequence and returns each intermediate result.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements in the source sequence. |
TAcc | The type of the accumulated value. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
seed | TAcc | The initial accumulator value. |
accumulator | Func | An accumulator function to be invoked on each element. Receives the current accumulator value and the current element. |
Returns: IObservableAsync
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if accumulator is null. |