interface UseFetchStateResult

Returned by useFetchState.

Type Parameters

Properties

setData: (fn: (data: T) => T) => void

Edits the loaded data, as when a next page comes in. It does nothing until loaded.

reload: () => void

Loads the key's data again, and replaces the data loaded with it, as the live pages do on useOnReconnect. Until it arrives, the data shown stays, and so it does if the load fails. It does nothing until loaded.

Usage

import { type UseFetchStateResult } from "src/hooks/shared/useFetchState.ts";