<PackageReference Include="ReactiveUI.Primitives.Core" Version="7.4.0" />

ReactiveUI.Primitives.Advanced.AggregateWitness<T, TResult, TAggregator>

public sealed class AggregateWitness<T, TResult, TAggregator> : IObserver<T>, IDisposable where TAggregator : struct, IAggregator<T, TResult, TAggregator>
Single-source sink that folds every observed value through an immutable value-type TAggregator and emits the aggregate result once the source completes. The accumulator is advanced functionally through a constrained (devirtualized, allocation-free) call, so each concrete aggregate operator shares this one implementation without a base class or per-value indirection.
public AggregateWitness(IObserver<TResult> observer, TAggregator aggregator)

Single-source sink that folds every observed value through an immutable value-type TAggregator and emits the aggregate result once the source completes. The accumulator is advanced functionally through a constrained (devirtualized, allocation-free) call, so each concrete aggregate operator shares this one implementation without a base class or per-value indirection.

public void Dispose()

public void OnCompleted()

public void OnError(Exception error)

public void OnNext(T value)

public void SetSubscription(IDisposable subscription)

Assigns the upstream subscription, disposing it if one is already held.