<PackageReference Include="AsyncEnumerator" Version="2.1.0" />

System.Collections.Async.AsyncEnumerableWithState<TItem, TState>

Similar to AsyncEnumerable<T>, but allows you to pass a state object into the enumeration function, what can be used for performance optimization, so don't have to create a delegate on the fly every single time you create the enumerator.
protected TState State { get; }

A user state that gets passed into the enumeration function.

public AsyncEnumerableWithState(Func<Yield<TItem>, TState, Task> enumerationFunction, TState state)

public virtual Task<IAsyncEnumerator<TItem>> GetAsyncEnumeratorAsync(CancellationToken cancellationToken = default)

Creates an enumerator that iterates through a collection asynchronously