redux-toolkit
redux-toolkit copied to clipboard
Skipping all network requests if the user is offline as it keeps trying to refetch the data on failing.
Currently, I can prevent an individual network request (query) with "skip" option provided by RTK Query.
I want to skip all the queries from happening if the user is offline. what should I do to prevent recursive network request after failing as there's no option available to skip all the queries.
I've tried using AbortSignal and maxRetries, but that didn't work for me.
Is there's any better way to handle this ^.
Not really at this moment, I'm sorry.
@rehmankhan-cloudways Maybe try this approach, curtesy of @phryneas: https://github.com/reduxjs/redux-toolkit/issues/2916#issuecomment-1324630525
A global skip option would indeed be nice though, for such use cases.