Skip to content

Commit

Permalink
fix jquery code style
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 14, 2020
1 parent ee10f47 commit 9f91411
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -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 "-":
Expand Down
6 changes: 3 additions & 3 deletions jquery.redux.js
Expand Up @@ -6,20 +6,20 @@
return this.data( "state" );
}

if (action == "set-reducer" ) {
if ( action == "set-reducer" ) {
this.data( "reducer", options.reducer );
this.data(
"state",
options.reducer(null, {
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 );

0 comments on commit 9f91411

Please sign in to comment.