From cf7a05f80f68b5b1c8bcc0089679dd497cec2506 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 14 Jun 2015 23:53:32 -0800 Subject: first commit --- web/react/dispatcher/app_dispatcher.jsx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 web/react/dispatcher/app_dispatcher.jsx (limited to 'web/react/dispatcher/app_dispatcher.jsx') 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; -- cgit v1.2.3-1-g7c22