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
Once a store is created, you'll be able to add subscriptions with `subscribe` and request state updates with `dispatch`.
155
-
156
156
### subscribe
157
157
158
158
Adds a subscription to your store. It will always be tied to a single store, and subsequently state object.
@@ -204,7 +204,7 @@ const fooBar = new FooItems()
204
204
fooBar.addToFoo("bop")
205
205
```
206
206
207
-
Now when the `addItem` method is clicked, `dispatch` will tell your store to begin the state update process. Your reducer receives the action type and payload.
207
+
Now when the `addItem` method is called, `dispatch` will tell your store to begin the state update process. Your reducer receives the action type and payload.
208
208
209
209
The next step being that your reducer could have a logic branch on the action type called `ADD_FOO_ITEM` which adds the given item to state, then returns the resulting new state.
0 commit comments