MCPcopy Create free account
hub / github.com/Botloader/botloader / FetchData

Function FetchData

frontend/src/components/FetchData.tsx:134–145  ·  view source on GitHub ↗
({ loader, context, children, debugName }: {
    loader: () => Promise<T | undefined>,
    context: React.Context<FetchDataHook<ResolvedApiResult<T>>>,
    debugName?: string,
    children: ReactNode
})

Source from the content-addressed store, hash-verified

132}
133
134export 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
148export function useFetchedData<T, Guarded extends boolean = false>(context: React.Context<FetchDataHook<T, Guarded>>): FetchDataHook<T, Guarded> {

Callers

nothing calls this directly

Calls 1

useFetchDataFunction · 0.85

Tested by

no test coverage detected