diff options
Diffstat (limited to 'web/src/js/actions.js')
-rw-r--r-- | web/src/js/actions.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/web/src/js/actions.js b/web/src/js/actions.js new file mode 100644 index 00000000..9211403f --- /dev/null +++ b/web/src/js/actions.js @@ -0,0 +1,38 @@ +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 event_id = 0; +var EventLogActions = { + add_event: function(message){ + AppDispatcher.dispatchViewAction({ + type: ActionTypes.ADD_EVENT, + data: { + message: message, + level: "web", + id: "viewAction-"+event_id++ + } + }); + } +};
\ No newline at end of file |