1) I would say that you could fire multiple calls to dispatch for each of your actions, or (if possible) create a new action type (a so-called "super-action") that's actually a collection of other actions.
2) Keep in mind that you action can be any sort of object. So in addition to type (which exists so you know what action you are working with), you can add in other data. An action can look like:
{
type: "UPDATE_STRING",
newString: "This is the new string!"
}
And then the reducer would update the state by using action.newString
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
1) I would say that you could fire multiple calls to
dispatch
for each of your actions, or (if possible) create a new action type (a so-called "super-action") that's actually a collection of other actions.2) Keep in mind that you action can be any sort of object. So in addition to
type
(which exists so you know what action you are working with), you can add in other data. An action can look like:And then the reducer would update the
state
by usingaction.newString