Skip to content

Commit d43609e

Browse files
committed
Added action pass-through to compose, closes #19. Also removed Bower, /dist, minification.
1 parent 03bc0ea commit d43609e

File tree

11 files changed

+142
-323
lines changed

11 files changed

+142
-323
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
A very lightweight (anti-gravity?) data model and [Flux](https://facebook.github.io/flux/) store with actions and a state change listener.
44

5-
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Bower version][bower-image]][bower-url]
5+
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]
66

77
[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]
88

99

1010
## Installation
1111

12-
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).
1313

1414
For more information, check out the [Concept](#concept), [Usage](#usage), [Documentation](#documentation) and [FAQ](#faq) below.
1515

@@ -18,10 +18,6 @@ For more information, check out the [Concept](#concept), [Usage](#usage), [Docum
1818
npm install hoverboard
1919
```
2020

21-
```
22-
bower install hoverboard-flux
23-
```
24-
2521
## Concept
2622

2723
Hoverboard greatly simplifies [Flux](https://facebook.github.io/flux/) while staying true to the concept.
@@ -127,7 +123,7 @@ store = Hoverboard(actions);
127123
var items = state.items;
128124

129125
items[id].hidden = true;
130-
126+
131127
// return the new state
132128
return { items: items };
133129
},
@@ -167,7 +163,7 @@ store = Hoverboard(actions);
167163
- `unsubscribe = store.getState(function)` or `unsubscribe = store(function)`
168164

169165
- Adds a listener to the state of a store.
170-
166+
171167
- The listener callback will be called immediately, and again whenever the state changed.
172168

173169
- Returns an unsubscribe function. Call it to stop listening to the state.
@@ -176,7 +172,7 @@ store = Hoverboard(actions);
176172
unsubscribe = store.getState(function(state) {
177173
alert(state.value);
178174
});
179-
175+
180176
// stop listening
181177
unsubscribe();
182178
```
@@ -233,6 +229,11 @@ var gameStore = Hoverboard.compose({
233229
health: healthStore
234230
})
235231
});
232+
233+
// stores and actions can be accessed with the same structure
234+
gameStore.score.add(2);
235+
236+
gameStore.character.health.hit(1);
236237
```
237238

238239
You can also pass zero or more translate functions after your compose definition,

bower.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

dist/hoverboard.js

Lines changed: 0 additions & 192 deletions
This file was deleted.

dist/hoverboard.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/util/react/mixin.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

dist/util/react/mixin.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/clickCounter.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</head>
77
<body>
88

9-
<script src="../dist/hoverboard.min.js"></script>
9+
<script src="../src/index.js"></script>
1010

1111
<script>
1212
var ClickCounter = Hoverboard({
@@ -39,6 +39,6 @@
3939

4040
ClickCounter.click("This won't show up");
4141
</script>
42-
42+
4343
</body>
44-
</html>
44+
</html>

0 commit comments

Comments
 (0)