Last active
August 29, 2015 14:23
-
-
Save tribou/8a477c4d2b6749cb1983 to your computer and use it in GitHub Desktop.
Todo app dispatcher for React and Flux architecture
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
// Todo app dispatcher with actions responding to both | |
// view and server actions | |
var Dispatcher = require('flux').Dispatcher; | |
var AppDispatcher = new Dispatcher(); | |
AppDispatcher.handleViewAction = function(action) { | |
this.dispatch({ | |
source: 'VIEW_ACTION', | |
action: action | |
}); | |
} | |
AppDispatcher.handleServerAction = function(action) { | |
this.dispatch({ | |
source: 'SERVER_ACTION', | |
action: action | |
}); | |
} | |
module.exports = AppDispatcher; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment