overtime.elapsedTime not reported when isFetching on on isLoading
overtime.elapsedTime not reported when isFetching only on isLoading
useTable, , useForm, , and useModalForm. This property represents the elapsed time in milliseconds and becomes undefined when the request is completed.isLoading is on, it might be due to the request being completed, hence setting to undefined.useTable hook:useForm hook:number to determine the ticking intervals and to be called on each tick.undefined when the request is completed. If you're experiencing an issue where is not reported during a re-fetching operation, it might be due to the request being completed quickly, hence setting to undefined.useTable hook:number to determine the ticking intervals and to be called on each tick.true. This means that a fetch operation is in progress. However, becomes undefined when the request is completed. undefined during subsequent fetch operations (not the first load), it might be due to the request being completed quickly, hence setting to undefined.number to determine the ticking intervals and to be called on each tick.overtime.elapsedTimeovertime.elapsedTimeovertime.elapsedTimeovertime.elapsedTimeovertime.elapsedTimeovertime.elapsedTimeovertime.elapsedTimeovertime.elapsedTimeovertime.elapsedTimeuseDataGriduseShowisFetchingisFetchingelapsedTimeelapsedTimeelapsedTimeovertimeOptionsovertimeOptionsovertimeOptionsintervalintervalintervalonIntervalonIntervalonIntervalconst { isFetching, overtime } = useCustom({
url: `${apiUrl}/api/post/files`,
method: "post",
dataProviderName: "api",
config: { payload: { location: props.activeLocation, host: props.host } },
queryOptions: {
queryKey: ["files", props.activeLocation || "root"],
refetchInterval: props.depth === 0 ? 1000 * 60 : 0,
onSuccess: (data) => {
setData(data?.data);
},
},
});
if (isFetching) {
console.log("Fetching data", overtime.elapsedTime);
return <LinearProgress />;
}Return overtime object from this hook. elapsedTime is the elapsed time in milliseconds. It becomes undefined when the request is completed.import { useTable } from "@refinedev/core";
const { overtime } = useTable();
console.log(overtime.elapsedTime); // undefined, 1000, 2000, 3000 4000, ...import { useTable } from "@refinedev/core";
const { overtime } = useTable();
console.log(overtime.elapsedTime); // undefined, 1000, 2000, 3000 4000, ...const { overtime: { elapsedTime } } = useForm({ ... }); const { overtime } = useTable({
overtimeOptions: {
interval: 1000,
onInterval(elapsedInterval) {
console.log(elapsedInterval);
},
},
}); const { overtime } = useTable({
overtimeOptions: {
interval: 1000,
onInterval(elapsedInterval) {
console.log(elapsedInterval);
},
},
}); const { overtime } = useCustom({
// your options
overtimeOptions: {
interval: 1000,
onInterval(elapsedInterval) {
console.log(elapsedInterval);
},
},
});