Function useLoadDataState
- useLoadDataState<T>(onLoad): [state: LoadDataState<T>, handleRefresh: (() => void), setResult: React.Dispatch<React.SetStateAction<T>>]
-
Parameters
-
onLoad: ((abortSignal) => Promise<T>)
-
- (abortSignal): Promise<T>
-
Returns Promise<T>
Returns [state: LoadDataState<T>, handleRefresh: (() => void), setResult: React.Dispatch<React.SetStateAction<T>>]
This function is a react hook for managing the state involved with loading data.
Example