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
{{ message }}
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.
I found a weird behavior when I need to dispatch another action while handling LOCATION_CHANGE
varchangeMiddleware=(store)=>{return(next)=>{return(action)=>{/** there can be multiple other action types detected who will dispatch TRACK_IT action */if(action.type===LOCATION_CHANGE){store.dispatch({type: 'TRACK_IT'});}returnnext(action);};};};
The reason for this is to be able to aggregate TRACK_IT actions with rxjs and handle them in bulks.
When I go from page A to page B it will result in following navigation changes:
A -> B
B -> A
A -> B
This only happens with adjustUrlOnReplay: true and only if there is another action dispatched before return next(action)
I have no idea if I have it setup incorrectly or if I'm just doing something wrong.
Fiddle with demonstration is https://jsfiddle.net/akhoegsk/ just click on the 3 links one after one a then click back a few times. It should behave like browser back button but instead it just cycles between the last 2 There are listenBefore and listen handlers setup.
Thank you for any information
Jan
The text was updated successfully, but these errors were encountered:
Hi,
I found a weird behavior when I need to dispatch another action while handling LOCATION_CHANGE
The reason for this is to be able to aggregate TRACK_IT actions with rxjs and handle them in bulks.
When I go from page A to page B it will result in following navigation changes:
A -> B
B -> A
A -> B
This only happens with
adjustUrlOnReplay: true
and only if there is another action dispatched beforereturn next(action)
I have no idea if I have it setup incorrectly or if I'm just doing something wrong.
Fiddle with demonstration is https://jsfiddle.net/akhoegsk/ just click on the 3 links one after one a then click back a few times. It should behave like browser back button but instead it just cycles between the last 2 There are listenBefore and listen handlers setup.
Thank you for any information
Jan
The text was updated successfully, but these errors were encountered: