You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell, Redux Offline (RO) relies on changes in navigator.onLine to determine online status. This is problematic because it's unreliable. I wrote a small function that pings our API to test the connection, so I have two questions:
Is 'detectNetwork' the proper place to implement my ping method? Documentation and research are unclear as to exactly when this method gets called.
Instead of using 'detectNetwork', suppose I manually handle pinging the network, dispatching the "Offline/STATUS_CHANGED" with the result, and synchronizing the redux store. The question is, how do I manually prompt RO to begin processing items in its outbox?
Here is how I have implemented RO in my React/Typescript application:
import offlineConfig from '@redux-offline/redux-offline/lib/defaults';
import reducers from './reducers';
import persistCallback from './middleware/persistCallback';
const customConfig = {
...offlineConfig,
persistCallback: persistCallback,
};
export const store = configureStore({
reducer: reducers,
enhancers:[offline(customConfig)]
});
If anyone has a picture or a timeline of how RO is operating, that would be a great addition to the documentation.
The text was updated successfully, but these errors were encountered:
As far as I can tell, Redux Offline (RO) relies on changes in
navigator.onLine
to determine online status. This is problematic because it's unreliable. I wrote a small function that pings our API to test the connection, so I have two questions:Is 'detectNetwork' the proper place to implement my ping method? Documentation and research are unclear as to exactly when this method gets called.
Instead of using 'detectNetwork', suppose I manually handle pinging the network, dispatching the "Offline/STATUS_CHANGED" with the result, and synchronizing the redux store. The question is, how do I manually prompt RO to begin processing items in its outbox?
Here is how I have implemented RO in my React/Typescript application:
If anyone has a picture or a timeline of how RO is operating, that would be a great addition to the documentation.
The text was updated successfully, but these errors were encountered: