Redux thunk: how to await completion of an async action
<p>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?</p>

<p>I need to fetch CSRF token before each POST request to server, and for both procedure there's an corresponding action.</p>

<p>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.</p>

<p>How I can synchronize the action creator calling code with redux thunk dispatching those actions?</p>