Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc9be910

Browse files
committed
Merge branch 'master' ofhttps://github.com/alexfoxy/juicr
2 parents6d2f33c +6056245 commitc9be910

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎README.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ A simple (and tiny ~1kb) redux inspired reducer for handling state, actions, rea
77
I liked the redux pattern but the amount of boiler plate seemed overkill, especially for smaller projects.
88

99
###Examples
10-
All examples use the same[juicr](https://github.com/alexfoxy/juicr.js/blob/master/codepen_ext/todoJuicr.js) code.
10+
All examples use the same[juicr](https://github.com/alexfoxy/juicr.js/blob/master/codepen_ext/todoJuicr.js)reducercode.
1111

1212
-[React.js Todo](https://codepen.io/alexfoxy/pen/eowpdb)
13+
-[Vanilla JS Todo](https://codepen.io/alexfoxy/pen/wZLWpp)
1314
-[Reef.js Todo](https://codepen.io/alexfoxy/pen/vMqNbZ)
1415

1516
##Setup
@@ -40,8 +41,9 @@ juicr.action("count", (amount, _state) => {
4041
```
4142
3) Listen to state changes. You can either listen to a single property, an array or use`*` to listen to all changes:
4243
```javascript
43-
juicr.listen("count", (changedState,_state)=> {
44-
console.log(changedState.count)
44+
juicr.listen("*", (changedState,_state)=> {
45+
document.body.innerHTML=changedState.count
46+
/* or your front end library update function e.g. this.setState({ ...changedState })*/
4547
})
4648
```
4749
4) Dispatch actions to the Juicr:
@@ -52,7 +54,7 @@ setInterval(() => {
5254
```
5355
Play with this example in [CodePen](https://codepen.io/alexfoxy/pen/gyNaYw).
5456
55-
For use with React see#use-with-react--react-native
57+
For use with React see: [Use with React & React Native](https://github.com/alexfoxy/juicr.js#use-with-react--react-native)
5658
5759
## API
5860
####`newJuicr({ initialState={}, dev=false })`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp