@playlive/react-data
    Preparing search index...

    Interface UseFetchResult<T>

    Return shape for every hook in this package + every counterpart hook in @playlive/react-query.

    interface UseFetchResult<T> {
        data: T | undefined;
        error: Error | null;
        isFetching: boolean;
        isLoading: boolean;
        isPending: boolean;
        refetch: () => Promise<void>;
    }

    Type Parameters

    • T

      Concrete data payload returned by the underlying fetcher.

    Index
    data: T | undefined

    Latest resolved data, or undefined until the first success.

    error: Error | null

    Most recent error thrown by the fetcher, or null on success.

    isFetching: boolean

    true whenever a fetch is in flight — covers the initial load, polling ticks, and manual refetch() calls. Mirrors TanStack Query's isFetching semantics.

    isLoading: boolean

    true from mount (or enabled flipping true) until the first resolve/reject; flips back to true whenever refetch() runs with no cached data.

    isPending: boolean

    true while the query has neither resolved data nor a captured error — i.e. we haven't checked/fetched yet. Mirrors TanStack Query v5's isPending (status === 'pending'): stays true when enabled is false, and only flips to false once the fetcher succeeds or errors.

    refetch: () => Promise<void>

    Manually trigger a refetch. Cancels any in-flight request.