Reputation: 123
When user is signing up. After form is submitted i want to dispatch authUser action. But i need to wait until signUp action is finished. How i can achieve that?
I've tried to dispatch one action after another but both actions are async, so they are performed simultaneously.
Upvotes: 3
Views: 2129
Reputation: 123
I'm not sure if this is the best way of doing this but i found working solution.
dispatch(first)
.unwrap()
.then(() => dispatch(second).unwrap());
}}
Upvotes: 1