,System.Collections.Generic.IEnumerable{--0})}
ObserverExtensions.FastForEach(IObserver, IEnumerable) method¶
Defined in
Type: ObserverExtensions
Namespace: ReactiveUI.Extensions
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
public static void FastForEach<T>(this IObserver<T> observer, IEnumerable<T> source)
Summary:
Emits each element from source to observer
via OnNext using a fast-path iteration for known
concrete collection types (List, arrays, IList).
Avoids the per-iteration enumerator allocation that foreach over a bare
IEnumerable would incur on these common shapes.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source collection. |
Parameters
| Name | Type | Description |
|---|---|---|
observer | IObserver | The observer to emit elements to. |
source | IEnumerable | The source collection to iterate. |