Interface: FetchStateRequest
@react-logic/utilsDefined in: utils/src/lib/fetch-state.ts:126
The full request descriptor a build callback may return — same as
FetchStateConfig plus a required url. Either both helpers'
callbacks return this object, or a bare URL string as a shorthand for
{ url }.
Extends
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.
Inherited from
fetcher?
optionalfetcher?:FetchAdapter
Defined in: utils/src/lib/fetch-state.ts:114
Per-call HTTP adapter, overriding the global one set via
setFetchStateAdapter.
Inherited from
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>
Inherited from
url
url:
string
Defined in: utils/src/lib/fetch-state.ts:127