MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / useStableData

Function useStableData

app/src/utils/hooks.ts:218–229  ·  view source on GitHub ↗
(result: UseQueryResult<TData, TError>)

Source from the content-addressed store, hash-verified

216
217// Prevent annoying flashes while loading from the server
218const useStableData = <TData, TError>(result: UseQueryResult<TData, TError>) => {
219 const { data, isFetching } = result;
220 const [stableData, setStableData] = useState(result.data);
221
222 useEffect(() => {
223 if (!isFetching) {
224 setStableData(data);
225 }
226 }, [data, isFetching]);
227
228 return { ...result, data: stableData };
229};
230
231export const useTrainingEntries = () => {
232 const fineTune = useFineTune().data;

Callers 6

useNodeEntriesFunction · 0.85
useNodeEntryFunction · 0.85
useTrainingEntriesFunction · 0.85
useTestingEntriesFunction · 0.85
useModelTestingStatsFunction · 0.85
useAdminProjectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected