Skip to main content

Refreshing

In many cases, we need to periodically update our data so that the user has access to the latest version of what is on the server. It's very easy, just set the appropriate interval and turn on refreshing.


Example

import { useFetch } from "@better-typed/react-hyper-fetch";
import { DateInterval } from "@better-typed/hyper-fetch";

const { data, error, loading } = useFetch(getPaginatedList, { refresh: true, refreshTime: DateInterval.second * 10 });