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;