You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The workaround I use now is to make country an optional argument of readCities, but I feel this is making the code needlessly complex. Especially with larger/complexer stores/actions.
selectCountry: (state,actions,country)=>{actions.readCities(country);return{selectedCountry: country};},readCities: (state,actions,country)=>{
country =country||state.selectedCountry;// etc...}
The text was updated successfully, but these errors were encountered:
What is the recommended way to chain actions where the second action is dependent on the first action to update the state?
For example. Selecting a country in a dropdown and then fetch a list of cities once one is selected.
This obviously doesn't work.
The workaround I use now is to make country an optional argument of
readCities
, but I feel this is making the code needlessly complex. Especially with larger/complexer stores/actions.The text was updated successfully, but these errors were encountered: