Files
old-csveditor/app/dispatcher/CsvEditorDispatcher.js
2014-12-22 10:58:42 +01:00

35 lines
860 B
JavaScript

var Constants = require('../constants/CsvEditorConstants');
var Dispatcher = require('flux').Dispatcher;
var assign = require('object-assign');
var CsvEditorDispatcher = assign(new Dispatcher(), {
/**
* @param {object} action The details of the action, including the action's
* type and additional data coming from the server.
*/
handleBackendAction: function(action) {
var payload = {
source: PayloadSources.BACKEND_ACTION,
action: action
};
this.dispatch(payload);
},
/**
* @param {object} action The details of the action, including the action's
* type and additional data coming from the view.
*/
handleViewAction: function(action) {
var payload = {
source: PayloadSources.VIEW_ACTION,
action: action
};
this.dispatch(payload);
}
});
module.exports = CsvEditorDispatcher;