diff options
Diffstat (limited to 'web/react/dispatcher')
-rw-r--r-- | web/react/dispatcher/app_dispatcher.jsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/web/react/dispatcher/app_dispatcher.jsx b/web/react/dispatcher/app_dispatcher.jsx new file mode 100644 index 000000000..4ae28e8eb --- /dev/null +++ b/web/react/dispatcher/app_dispatcher.jsx @@ -0,0 +1,30 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +var Dispatcher = require('flux').Dispatcher; +var assign = require('object-assign'); + +var Constants = require('../utils/constants.jsx'); +var PayloadSources = Constants.PayloadSources; + +var AppDispatcher = assign(new Dispatcher(), { + + handleServerAction: function(action) { + var payload = { + source: PayloadSources.SERVER_ACTION, + action: action + }; + this.dispatch(payload); + }, + + handleViewAction: function(action) { + var payload = { + source: PayloadSources.VIEW_ACTION, + action: action + }; + this.dispatch(payload); + } + +}); + +module.exports = AppDispatcher; |