diff --git a/README.md b/README.md index 094cd2a..78c5ef6 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ Note! Make sure to include it _after_ jquery!! ```js var initialState = 0; -function reducer(state, action) { +function reducer( state, action ) { state = state || initialState - switch(action.type) { + switch( action.type ) { case "+": return state + 1 case "-": diff --git a/jquery.redux.js b/jquery.redux.js index 813211f..1658342 100644 --- a/jquery.redux.js +++ b/jquery.redux.js @@ -6,7 +6,7 @@ return this.data( "state" ); } - if (action == "set-reducer" ) { + if ( action == "set-reducer" ) { this.data( "reducer", options.reducer ); this.data( "state", @@ -14,12 +14,12 @@ type: "@jQuery/init" }) ); - return this; + return this; } if ( action == "dispatch" ) { this.data( "state", this.data( "reducer" )( this.data( "state" ), options.action ) ); - return this; + return this; } } })( jQuery, ( eval, eval )( "this" ), void undefined );