Is it possible to wait for some redux state change in an async function to write code without callbacks in one handler.
async function processSomething() {
const results = await showModal();
// work with results
}
async function showModal() {
dispatch(showModalForm()); // Change Modal form to be active
// wait till modal is closed. (state.active)
return getState().someResults;
}
======
I've generally done it combining these answers:
Resolve Javascript Promise outside the Promise constructor scope