axios-multi-api icon indicating copy to clipboard operation
axios-multi-api copied to clipboard

[Feature] Add revalidateOnReconnect and revalidateOnFocus

Open MattCCC opened this issue 1 year ago • 0 comments

The revalidateOnReconnect feature ensures that when the network connection is restored after being offline, the request automatically revalidates and fetches fresh data. This is particularly useful in scenarios where the user experiences intermittent connectivity. When enabled, fetchff detects the network's reconnection and re-sends the request to ensure that the data is up-to-date. It enhances the user experience by preventing stale data from being used after the connection is re-established, without requiring any manual intervention.

The revalidateOnFocus feature triggers a revalidation of data when the user returns focus to the application or tab. This ensures that data is always current after the user navigates away from the page or switches between tabs. When this option is enabled in fetchff, it automatically detects the focus event and sends a new request to refresh the data. This functionality is especially beneficial in dynamic applications where content is frequently updated and should remain relevant without relying on manual refresh actions.

MattCCC avatar Oct 04 '24 17:10 MattCCC