var ActionTypes = { //Settings UPDATE_SETTINGS: "update_settings", //EventLog ADD_EVENT: "add_event", //Flow ADD_FLOW: "add_flow", UPDATE_FLOW: "update_flow", }; var SettingsActions = { update: function (settings) { settings = _.merge({}, SettingsStore.getAll(), settings); //TODO: Update server. //Facebook Flux: We do an optimistic update on the client already. AppDispatcher.dispatchViewAction({ type: ActionTypes.UPDATE_SETTINGS, settings: settings }); } }; var EventLogActions = { add_event: function(message, level){ AppDispatcher.dispatchViewAction({ type: ActionTypes.ADD_EVENT, data: { message: message, level: level || "info", source: "ui" } }); } };