You must remember that even if async awaitit looks synchronous, it uses Promises under the hood, and the function asyncalways returns Promise, regardless of whether you use it awaitor not.
createAction , .
, :
const fakeCall = () => new Promise(resolve => {
setTimeout(() => resolve({ response: 'ok' }), 1E3)
})
const fooAction = createAction('FOO', async () => {
const { response } = await fakeCall()
return response
})
const foo = () => dispatch =>
dispatch(fooAction())
.then(() => dispatch(bar()))
const foo = () => async dispatch => {
await dispatch(fooAction())
dispatch(bar())
}