(path: string)
| 7 | import { useRemoteStore } from './remoteStore'; |
| 8 | |
| 9 | const 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 | |
| 19 | export const useInitialSync = (connectionStatus: ConnectionStatus) => { |
| 20 | const refetchAll = useCallback(async () => { |