I am using useReducer
, and want to dispatch
2 times. Is it guaranteed that the state fed to the reducer the second time is output of the first update?
If I do this
dispatch({ type:"RESET" }); // set state to default state
dispatch({ type:"LOAD", id: "abc" }); // set id
Can I be sure that state will be { ...defaultState, id: "abc" }
?