Skip to main content
Version: 1.x.x

getInitialState


import { getInitialState } from "@hyper-fetch/react"

Description

Defined in helpers/use-tracked-state/use-tracked-state.utils.ts:61

Preview

getInitialState<T>(initialData, dispatcher, command)

Parameters

NameDetails

initialData

Required

ClientResponseType<ExtractResponse<T>, ExtractError<T>>

dispatcher

Required

Dispatcher

command

Required

T

Returns

{
data: null | T extends Command<infer D, any, any, any, any, any, any, any, any, any> ? D : never;
error: null | T extends Command<any, any, any, infer G, infer L, any, any, any, any, any> ? \G\ | \L\ : never;
loading: boolean;
retries: number;
status: null | number;
timestamp: null | Date;
}