@@ -7,9 +7,10 @@ A simple (and tiny ~1kb) redux inspired reducer for handling state, actions, rea
77I 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 ) reducer code.
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` ` `
41423) 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` ` `
47494) Dispatch actions to the Juicr:
@@ -52,7 +54,7 @@ setInterval(() => {
5254` ` `
5355Play 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####` new Juicr ({ initialState= {}, dev= false })`