Interface: FetchStateConfig
@react-logic/utilsDefined in: utils/src/lib/fetch-state.ts:96
Common config fields shared by fetchState and callableFetchState.
Mirrors RequestInit so method, headers, credentials, etc. land
directly on the config object — plus the wrapper-specific parse and
fetcher fields. Plain-object bodies are auto-stringified.
Type Parameters
T
T = unknown
The parsed response type.
Properties
body?
optionalbody?:FetchStateBody
Defined in: utils/src/lib/fetch-state.ts:102
Plain objects/arrays are JSON-stringified; BodyInit values pass
through untouched.
fetcher?
optionalfetcher?:FetchAdapter
Defined in: utils/src/lib/fetch-state.ts:114
Per-call HTTP adapter, overriding the global one set via
setFetchStateAdapter.
parse?
optionalparse?: (response) =>Promise<T>
Defined in: utils/src/lib/fetch-state.ts:109
How to turn the response into the value. Defaults to a function that
throws when !ok and returns r.json() as T otherwise. Throw inside
parse to land in the failed state with that error and the response's
status.
Parameters
response
Returns
Promise<T>