namespace BlazorPages.Tools
{
    public sealed class InfiniteScrollingItemsProviderRequest
    {
        public InfiniteScrollingItemsProviderRequest(int startIndex, int page, CancellationToken cancellationToken)
        {
            StartIndex = startIndex;
            CancellationToken = cancellationToken;
            Page = page;
        }

        public int StartIndex { get; }
        public CancellationToken CancellationToken { get; }

        public int Page { get; }
    }

    public delegate Task<IEnumerable<T>> ItemsProviderRequestDelegate<T>(InfiniteScrollingItemsProviderRequest request);

}
