Last active
August 29, 2015 14:16
-
-
Save tomchentw/68b0c89d6f5e6d672e12 to your computer and use it in GitHub Desktop.
flux-comparison: facebook-flux
https://github.com/voronianski/flux-comparison/blob/master/facebook-flux/js/actions/ActionCreators.js
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
'use strict'; | |
var AppDispatcher = require('../dispatcher/AppDispatcher'); | |
var Constants = require('../constants/AppConstants'); | |
exports.addToCart = function (product) { | |
AppDispatcher.handleViewAction({ | |
type: Constants.ActionTypes.ADD_TO_CART, // it's just "ADD_TO_CART" | |
product: product | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment