From 51db9a5612f0899ed61751dbee3f4e4b19a74ea4 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 17 Sep 2014 02:13:37 +0200 Subject: formatting --- web/src/js/dispatcher.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'web/src/js/dispatcher.js') diff --git a/web/src/js/dispatcher.js b/web/src/js/dispatcher.js index 4f3cce0c..028ac4dc 100644 --- a/web/src/js/dispatcher.js +++ b/web/src/js/dispatcher.js @@ -4,32 +4,32 @@ const PayloadSources = { }; -function Dispatcher() {"use strict"; +function Dispatcher() { this.callbacks = []; } -Dispatcher.prototype.register=function(callback) {"use strict"; +Dispatcher.prototype.register = function (callback) { this.callbacks.push(callback); }; -Dispatcher.prototype.unregister=function(callback) {"use strict"; +Dispatcher.prototype.unregister = function (callback) { var index = this.callbacks.indexOf(f); if (index >= 0) { this.callbacks.splice(this.callbacks.indexOf(f), 1); } }; -Dispatcher.prototype.dispatch=function(payload) {"use strict"; +Dispatcher.prototype.dispatch = function (payload) { console.debug("dispatch", payload); - this.callbacks.forEach(function(callback) { + this.callbacks.forEach(function (callback) { callback(payload); }); }; AppDispatcher = new Dispatcher(); -AppDispatcher.dispatchViewAction = function(action) { +AppDispatcher.dispatchViewAction = function (action) { action.actionSource = PayloadSources.VIEW_ACTION; this.dispatch(action); }; -AppDispatcher.dispatchServerAction = function(action) { +AppDispatcher.dispatchServerAction = function (action) { action.actionSource = PayloadSources.SERVER_ACTION; this.dispatch(action); }; -- cgit v1.2.3