Last active
June 15, 2016 06:43
-
-
Save narendrashetty/1b18092ea6bb7f18500a39d32a1416c5 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
const action = { | |
type, // specify the action type | |
data // optional data can be passed | |
}; | |
Store.prototype.dispatch = function(action) { | |
// based on the action type | |
// generate a new state of the application, | |
// by passing it to a reducer | |
const state = this.reducer(action); | |
this.state = state; | |
// Brodcast the new state to all subscribers | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment