MCPcopy Index your code
hub / github.com/nukeop/nuclear / fetchJSON

Function fetchJSON

packages/player/src/remoteControl/useInitialSync.ts:9–17  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

7import { useRemoteStore } from './remoteStore';
8
9const fetchJSON = async <T>(path: string): Promise<T> => {
10 const response = await fetch(path);
11
12 if (!response.ok) {
13 throw new Error(`${path} returned ${response.status}`);
14 }
15
16 return response.json() as Promise<T>;
17};
18
19export const useInitialSync = (connectionStatus: ConnectionStatus) => {
20 const refetchAll = useCallback(async () => {

Callers 1

useInitialSyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected