Last active
August 29, 2015 14:23
-
-
Save tribou/b1df6694a50ddaecd96e to your computer and use it in GitHub Desktop.
Todo app actions 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 actions | |
var AppDispatcher = require('../dispatcher/AppDispatcher'); | |
var TodoConstants = require('../constants/TodoConstants'); | |
module.exports = { | |
addItem: function() { | |
AppDispatcher.handleViewAction({ | |
actionType: TodoConstants.NEW_ITEM | |
}); | |
}, | |
saveItem: function(text) { | |
AppDispatcher.handleViewAction({ | |
actionType: TodoConstants.SAVE_ITEM, | |
text: text | |
}); | |
}, | |
removeItem: function(index) { | |
AppDispatcher.handleViewAction({ | |
actionType: TodoConstants.REMOVE_ITEM, | |
index: index | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment