As redux thunk calls functions returned by action creators asynchronously, how I can ensure after calling the action creator that redux has actually dispatched the action before moving on?
I need to fetch CSRF token before each POST request to server, and for both procedure there's an corresponding action.
The problem is, if I call those action creators successively, POST action is for some reason getting dispatched before CSRF action is dispatched. I want to keep these concerns separated, so I don't want to combine the actions.
How I can synchronize the action creator calling code with redux thunk dispatching those actions?