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
There should be a simple API for refreshing the current route's data, which is to say re-triggering its thunk. This is a useful bit of functionality to be able to expose directly to users, e.g. by having a button somewhere in your site's layout that will reload data for whatever page is active. It is also important to be able to do programmatically, for example when some update is known to have caused the page's data to become stale.
The text was updated successfully, but these errors were encountered:
I think it would be fairly simple to do with the existing API - assuming you have redux-thunk set up:
constrefreshCurrentRoute=(dispatch,getState)=>{constcurrentLocation={type: getState().location.type,payload: getState().location.payload,// ...etc// maybe if you do something to avoid unecessary data loading you also need a flag to ensure that the refresh actually happens};dispatch(redirect(currentLocation));};
Then if you want to refresh the route data, you can dispatch(refreshCurrentRoute)
There should be a simple API for refreshing the current route's data, which is to say re-triggering its thunk. This is a useful bit of functionality to be able to expose directly to users, e.g. by having a button somewhere in your site's layout that will reload data for whatever page is active. It is also important to be able to do programmatically, for example when some update is known to have caused the page's data to become stale.
The text was updated successfully, but these errors were encountered: