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
You can use either npm or bower to install Hoverboard, or [download the standalone files here](https://github.com/jesseskinner/hoverboard/tree/master/dist).
12
+
You can use npm to install Hoverboard, or [download the raw file here](https://raw.githubusercontent.com/jesseskinner/hoverboard/master/src/index.js).
13
13
14
14
For more information, check out the [Concept](#concept), [Usage](#usage), [Documentation](#documentation) and [FAQ](#faq) below.
15
15
@@ -18,10 +18,6 @@ For more information, check out the [Concept](#concept), [Usage](#usage), [Docum
18
18
npm install hoverboard
19
19
```
20
20
21
-
```
22
-
bower install hoverboard-flux
23
-
```
24
-
25
21
## Concept
26
22
27
23
Hoverboard greatly simplifies [Flux](https://facebook.github.io/flux/) while staying true to the concept.
@@ -127,7 +123,7 @@ store = Hoverboard(actions);
127
123
var items = state.items;
128
124
129
125
items[id].hidden = true;
130
-
126
+
131
127
// return the new state
132
128
return { items: items };
133
129
},
@@ -167,7 +163,7 @@ store = Hoverboard(actions);
167
163
-`unsubscribe = store.getState(function)` or `unsubscribe = store(function)`
168
164
169
165
- Adds a listener to the state of a store.
170
-
166
+
171
167
- The listener callback will be called immediately, and again whenever the state changed.
172
168
173
169
- Returns an unsubscribe function. Call it to stop listening to the state.
@@ -176,7 +172,7 @@ store = Hoverboard(actions);
176
172
unsubscribe = store.getState(function(state) {
177
173
alert(state.value);
178
174
});
179
-
175
+
180
176
// stop listening
181
177
unsubscribe();
182
178
```
@@ -233,6 +229,11 @@ var gameStore = Hoverboard.compose({
233
229
health: healthStore
234
230
})
235
231
});
232
+
233
+
// stores and actions can be accessed with the same structure
234
+
gameStore.score.add(2);
235
+
236
+
gameStore.character.health.hit(1);
236
237
```
237
238
238
239
You can also pass zero or more translate functions after your compose definition,
0 commit comments