Interface: FetchResponse
Imported from
@react-logic/utilsDefined in: utils/src/lib/fetch-adapter.ts:21
Minimal Response-like surface that fetchState's parse function
consumes. Both the native fetch Response and a custom adapter (e.g.
the axios one in this package) need to expose this shape.
Properties
ok
readonlyok:boolean
Defined in: utils/src/lib/fetch-adapter.ts:23
True when status is in the 200-299 range.
status
readonlystatus:number
Defined in: utils/src/lib/fetch-adapter.ts:25
HTTP status code.
Methods
json()
json():
Promise<unknown>
Defined in: utils/src/lib/fetch-adapter.ts:27
Parse body as JSON. Defaults to unknown — narrow with parse.
Returns
Promise<unknown>
text()
text():
Promise<string>
Defined in: utils/src/lib/fetch-adapter.ts:29
Parse body as text.
Returns
Promise<string>