Interface FetcherHookResponse<V>

Type Parameters

  • V

Hierarchy

  • FetcherHookResponse

Properties

get: (() => V)

Type declaration

    • (): V
    • Get the data. If it has not been fetched before, this will suspend the component.

      Returns V

isRevalidating: boolean

If you called revalidate with a transition, this will be true while the new data is being fetched.

mutate: ((nextValueOrUpdaterFn) => void)

Type declaration

    • (nextValueOrUpdaterFn): void
    • Update the local cache for the data.

      Parameters

      • nextValueOrUpdaterFn: SetStateArg<V>

      Returns void

      Remark

      If you want to update the cache and re-feth the data, use revalidate instead.

revalidate: ((nextValueOrUpdaterFn?, options?) => void)

Type declaration

    • (nextValueOrUpdaterFn?, options?): void
    • Trigger a re-fetch of the data.

      By default, it will do so in a transition (meaning, React will show the old data and wait for the updated data to be fetched before showing it).

      If you want to suspend the component tree and show the fallback of the nearest Suspense boundary, pass withTransition: false.

      Parameters

      • Optional nextValueOrUpdaterFn: SetStateArg<V>
      • Optional options: {
            withTransition?: boolean;
        }
        • Optional withTransition?: boolean

      Returns void

      Remark

      If you want to update the cache without re-fetching the data, use mutate instead.

Generated using TypeDoc