Last active
June 15, 2016 06:44
-
-
Save narendrashetty/65a37cee3eadd3d20130415e9ebd302b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Store.prototype.reducer = function(action) { | |
// create a clone of the state | |
let state = Object.assign({}, this.state); | |
switch(action.type) { | |
case 'INIT': | |
state.data = action.data; | |
return state; | |
default: | |
return state; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment