Skip to content

Commit 654be8e

Browse files
authored
Merge pull request #7 from geotrev/develop
Develop
2 parents 87592d4 + a6c8c84 commit 654be8e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ const { subscribe, dispatch } = createStore(
104104
export { subscribe, dispatch }
105105
```
106106

107-
here's a breakdown of each binding needed when initializing a new store:
107+
Once a store is created, you'll be able to add subscriptions with `subscribe` and request state updates with `dispatch`.
108+
109+
Here's a breakdown of each binding needed when initializing a new store:
108110

109111
```js
110112
/**
@@ -127,7 +129,7 @@ function reducer(type, state, payload) {
127129
* will have been automatically added to the store when this
128130
* function is called.
129131
*
130-
* @param {[object, *]} subscription - a tuple containing the new subscriber and its data
132+
* @param {[object, *]} subscription
131133
* @param {object} state - immutable copy of state
132134
*/
133135
function bindSubscriber(subscription, state) {
@@ -142,17 +144,15 @@ function bindSubscriber(subscription, state) {
142144
* beforehand, and requires you to manually do so
143145
* via the `setState` helper.
144146
*
145-
* @param {Array.<[object, *]>} subscriptions - array of subscriptions to your store
146-
* @param {object} nextState - the version of state given by your reducer.
147-
* @param {Function} setState - function that takes your state object and assigns it back to the store.
147+
* @param {Array.<[object, *]>} subscriptions - array of all subscriptions
148+
* @param {object} nextState - the version of state given by your reducer
149+
* @param {Function} setState - binds state to the store
148150
*/
149151
function bindState(subscriptions, nextState, setState) {
150152
// ...
151153
}
152154
```
153155

154-
Once a store is created, you'll be able to add subscriptions with `subscribe` and request state updates with `dispatch`.
155-
156156
### subscribe
157157

158158
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()
204204
fooBar.addToFoo("bop")
205205
```
206206

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.
208208

209209
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.
210210

0 commit comments

Comments
 (0)