29 lines
658 B
JavaScript
29 lines
658 B
JavaScript
var AppDispatcher = require('../dispatcher/appDispatcher');
|
|
var CartConstants = require('../constants/cartConstants');
|
|
|
|
// Define action methods
|
|
var CartActions = {
|
|
|
|
load: function() {
|
|
AppDispatcher.handleAction({
|
|
actionType: CartConstants.LOAD
|
|
});
|
|
},
|
|
|
|
|
|
addItem: function(itemId) {
|
|
AppDispatcher.handleAction({
|
|
actionType: CartConstants.ADD_ITEM,
|
|
itemId: itemId
|
|
});
|
|
},
|
|
|
|
takeItemOut: function(itemId) {
|
|
AppDispatcher.handleAction({
|
|
actionType: CartConstants.TAKE_ITEM_OUT,
|
|
itemId: itemId
|
|
});
|
|
}
|
|
};
|
|
|
|
module.exports = CartActions; |