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

Function FetchDataGuarded

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

Source from the content-addressed store, hash-verified

117}
118
119export function FetchDataGuarded<T>({ loader, context, children, debugName }: {
120 loader: () => Promise<T>,
121 context: React.Context<FetchDataHook<ResolvedApiResult<T>>>,
122 debugName?: string,
123 children: ReactNode
124}) {
125 let hook = useFetchData(loader, debugName);
126
127 return <context.Provider value={hook}>
128 <FetchDataGuard context={context}>
129 {children}
130 </FetchDataGuard>
131 </context.Provider>
132}
133
134export function FetchData<T>({ loader, context, children, debugName }: {
135 loader: () => Promise<T | undefined>,

Callers

nothing calls this directly

Calls 1

useFetchDataFunction · 0.85

Tested by

no test coverage detected