From f42af5c1d8b959f82a51950269223d15de2fe525 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Sat, 9 Aug 2014 20:08:52 -0400 Subject: [PATCH 1/2] Use ChatConstants for PayloadSources in ChatAppDispatcher --- examples/flux-chat/js/dispatcher/ChatAppDispatcher.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js b/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js index 544bd8e0f72cbd..cf75864a11f78b 100644 --- a/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js +++ b/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js @@ -10,11 +10,14 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +var ChatConstants = require('../constants/ChatConstants'); var Dispatcher = require('./Dispatcher'); // var merge = require('react/lib/merge'); var copyProperties = require('react/lib/copyProperties'); +var PayloadSources = ChatConstants.PayloadSources; + var ChatAppDispatcher = copyProperties(new Dispatcher(), { /** @@ -23,7 +26,7 @@ var ChatAppDispatcher = copyProperties(new Dispatcher(), { */ handleServerAction: function(action) { var payload = { - source: 'SERVER_ACTION', + source: PayloadSources.SERVER_ACTION, action: action }; this.dispatch(payload); @@ -35,7 +38,7 @@ var ChatAppDispatcher = copyProperties(new Dispatcher(), { */ handleViewAction: function(action) { var payload = { - source: 'VIEW_ACTION', + source: PayloadSources.VIEW_ACTION, action: action }; this.dispatch(payload); From ed8b7992f3d33a3dceace39446eafa579f008022 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Sat, 9 Aug 2014 20:14:13 -0400 Subject: [PATCH 2/2] Cleanup commented "require" --- examples/flux-chat/js/dispatcher/ChatAppDispatcher.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js b/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js index cf75864a11f78b..23b6cccc4ce962 100644 --- a/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js +++ b/examples/flux-chat/js/dispatcher/ChatAppDispatcher.js @@ -12,8 +12,6 @@ var ChatConstants = require('../constants/ChatConstants'); var Dispatcher = require('./Dispatcher'); - -// var merge = require('react/lib/merge'); var copyProperties = require('react/lib/copyProperties'); var PayloadSources = ChatConstants.PayloadSources;