I'm new to Redux, I've seen a lot of people using some Middleware to handle asynchronous.
My question is, I can just do this:
fetch(myAPI)
.then(res => res.json())
.then(res => {
dispatch({
type: 'MY_ASYNC_ACTION',
res
})
})
I could just wait for the promise to resolve then dispatch my synchronous action.
What's the benefit of using middleware to handle asynchronous in Redux instead of just waiting for the promise to resolve?
I've seen lot's of tutorials about Redux, none of them wait the promise to resolve, what did I miss?