Skip to content

,--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)

View source

Summary: Applies an accumulator function over the observable sequence and returns each intermediate result using the specified asynchronous accumulator.

Type parameters

NameDescription
TThe type of the elements in the source sequence.
TAccThe type of the accumulated value.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
seedTAccThe initial accumulator value.
accumulatorFunc>An asynchronous accumulator function to be invoked on each element. Receives the current accumulator value, the current element, and a cancellation token.

Returns: IObservableAsync -- An observable sequence containing the accumulated values produced after each element is processed.

Exceptions

TypeCondition
System.ArgumentNullExceptionThrown if accumulator is null.

2. Overload

public static IObservableAsync<TAcc> Scan<T, TAcc>(this IObservableAsync<T> @this, TAcc seed, Func<TAcc, T, TAcc> accumulator)

View source

Summary: Applies an accumulator function over the observable sequence and returns each intermediate result.

Type parameters

NameDescription
TThe type of the elements in the source sequence.
TAccThe type of the accumulated value.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
seedTAccThe initial accumulator value.
accumulatorFuncAn accumulator function to be invoked on each element. Receives the current accumulator value and the current element.

Returns: IObservableAsync -- An observable sequence containing the accumulated values produced after each element is processed.

Exceptions

TypeCondition
System.ArgumentNullExceptionThrown if accumulator is null.