({ loader, context, children, debugName }: {
loader: () => Promise<T | undefined>,
context: React.Context<FetchDataHook<ResolvedApiResult<T>>>,
debugName?: string,
children: ReactNode
})
| 132 | } |
| 133 | |
| 134 | export function FetchData<T>({ loader, context, children, debugName }: { |
| 135 | loader: () => Promise<T | undefined>, |
| 136 | context: React.Context<FetchDataHook<ResolvedApiResult<T>>>, |
| 137 | debugName?: string, |
| 138 | children: ReactNode |
| 139 | }) { |
| 140 | let hook = useFetchData(loader, debugName); |
| 141 | |
| 142 | return <context.Provider value={hook}> |
| 143 | {children} |
| 144 | </context.Provider> |
| 145 | } |
| 146 | |
| 147 | |
| 148 | export function useFetchedData<T, Guarded extends boolean = false>(context: React.Context<FetchDataHook<T, Guarded>>): FetchDataHook<T, Guarded> { |
nothing calls this directly
no test coverage detected