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

    Interface UseFetchOptions

    Standard hook options shape. Identical to @playlive/react-data/types#UseFetchOptions.

    TanStack-specific knobs (staleTime, gcTime, suspense, etc.) are accepted as extras on each hook's options arg via intersection with TanStack's UseQueryOptions subset; this base shape covers only the keys both packages honour.

    interface UseFetchOptions {
        cachingEnabled?: boolean;
        enabled?: boolean;
        initialData?: unknown;
        maxPages?: number;
        refetchInterval?: number | false;
        retry?: number | boolean;
        retryDelay?: number;
        staleTime?: number;
    }
    Index
    cachingEnabled?: boolean

    Partition the query cache by a boolean caching flag. Two hook instances that pass different cachingEnabled values get separate cache slots — useful when the same campaign is fetched with and without cache-busting query params on the underlying fetcher. Contributes to the queryKey only; the fetcher itself is unchanged.

    enabled?: boolean

    Skip fetching when false. Defaults to true.

    initialData?: unknown

    Seed the query with pre-fetched data — matches TanStack's initialData. Route loaders should pass this so the first paint shows real data instead of the loading state (no flash of skeleton on route entry).

    Typed as unknown here so one shared option shape spans every hook. Cast at the call site if you want tighter typing:

    useCampaign(params, { initialData: loaded as unknown as UseFetchOptions["initialData"] });
    

    For useCampaigns (multi) initialData may also be an array indexed 1:1 against params — each row is seeded with its matching entry.

    maxPages?: number

    Cap the number of pages retained by useInfiniteQuery. Only meaningful for useInfiniteDonations; other hooks ignore it. TanStack Query v5 drops the oldest page when this limit is hit — matches the overlay convention of "fetch once then poll for new rows only".

    refetchInterval?: number | false

    Poll every N ms. Pass false to disable polling.

    retry?: number | boolean

    Retries on error. Defaults to 10 (workspace default). Pass false (or 0) to disable retries entirely — useful for hooks whose enabled clause depends on an id that may legitimately 404.

    retryDelay?: number

    Base delay (ms) for exponential backoff. Defaults to 1000.

    staleTime?: number

    Override the workspace-default staleTime (5_100 ms). Pass 0 to disable freshness windows entirely (every read refetches).