Update refetchInterval
Hello!
App that I'm working on is presumably working in multiple browser tabs/windows, I'm using queries with refetchInterval in few places, and interval is set to 3 minutes. This causes an issue where apps in different tabs seems to be out of sync, eg. first tab is refetching data at 10:00, 10:03, and so on, second tab is refetching data at 10:01, 10:04 and so on.
Is it possible to define refetchInterval as function, and provide custom logic which would allow to calculate different interval till first refetch, and after first refetch, upadte given interval, so all windows/tabs would trigger refetch at same time?
For example:
first tab triggers first fetch at 10:00, next refetch should happen at 10:03 - refetchInterval should never change as it is always exactly 3 minutes
second tab triggers first fetch at 10:01, next refetch should happen at 10:03 - refetchInterval is set to 2 minutes, and after first refetch it is updated to 3 minutes
I couldn't find such information in docs and by quickly looking at the source code it appears that it is possible, but I'm looking for confirmation.
App that I'm working on is presumably working in multiple browser tabs/windows, I'm using queries with refetchInterval in few places, and interval is set to 3 minutes. This causes an issue where apps in different tabs seems to be out of sync, eg. first tab is refetching data at 10:00, 10:03, and so on, second tab is refetching data at 10:01, 10:04 and so on.
Is it possible to define refetchInterval as function, and provide custom logic which would allow to calculate different interval till first refetch, and after first refetch, upadte given interval, so all windows/tabs would trigger refetch at same time?
For example:
first tab triggers first fetch at 10:00, next refetch should happen at 10:03 - refetchInterval should never change as it is always exactly 3 minutes
second tab triggers first fetch at 10:01, next refetch should happen at 10:03 - refetchInterval is set to 2 minutes, and after first refetch it is updated to 3 minutes
I couldn't find such information in docs and by quickly looking at the source code it appears that it is possible, but I'm looking for confirmation.