(options?: { datasetId?: string; refetchInterval?: number })
| 153 | }; |
| 154 | |
| 155 | export const useDataset = (options?: { datasetId?: string; refetchInterval?: number }) => { |
| 156 | const router = useRouter(); |
| 157 | |
| 158 | const datasetId = options?.datasetId ?? (router.query.id as string); |
| 159 | |
| 160 | const dataset = api.datasets.get.useQuery( |
| 161 | { id: datasetId }, |
| 162 | { enabled: !!datasetId, refetchInterval: options?.refetchInterval }, |
| 163 | ); |
| 164 | |
| 165 | return dataset; |
| 166 | }; |
| 167 | |
| 168 | export const useNode = ({ id }: { id?: string }) => |
| 169 | api.nodes.get.useQuery({ id: id as string }, { enabled: !!id }); |
no outgoing calls
no test coverage detected