soundcloud-api-ts-next
    Preparing search index...

    Interface InfiniteResult<T>

    Return shape for infinite/paginated hooks with cursor-based loading.

    const { data, loadMore, hasMore } = useInfiniteTrackSearch("lofi");
    // data is T[] accumulated across pages
    if (hasMore) loadMore();
    • HookResult for single-page hooks
    • useInfinite for the base infinite hook
    interface InfiniteResult<T> {
        data: T[];
        error: Error | null;
        hasMore: boolean;
        loading: boolean;
        loadMore: () => void;
        reset: () => void;
    }

    Type Parameters

    • T

      The type of each item in the collection.

    Index

    Properties

    data: T[]

    Accumulated items across all fetched pages.

    error: Error | null

    The last fetch error, if any.

    hasMore: boolean

    true if a next page is available.

    loading: boolean

    true while any page is being fetched.

    loadMore: () => void

    Fetch the next page. No-op if loading or no more pages.

    reset: () => void

    Clear all data and refetch from the first page.