I have a requirement to keep fetching data until a condition is met
I can set up the fetch on an interval with the snippet below but I can't figure out how to stop the fetchData when needed. Is this possible?
const { status: answersStatus, data: answers } = useQuery(
['fetchData', { context, activity, stage, country }],
fetchData,
{refetchInterval: 2000});