aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/dispatcher.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/dispatcher.js')
-rw-r--r--web/src/js/dispatcher.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/web/src/js/dispatcher.js b/web/src/js/dispatcher.js
index 310f9a7f..4f3cce0c 100644
--- a/web/src/js/dispatcher.js
+++ b/web/src/js/dispatcher.js
@@ -4,24 +4,24 @@ const PayloadSources = {
};
- function Dispatcher() {"use strict";
- this.callbacks = [];
+function Dispatcher() {"use strict";
+ this.callbacks = [];
+}
+Dispatcher.prototype.register=function(callback) {"use strict";
+ this.callbacks.push(callback);
+};
+Dispatcher.prototype.unregister=function(callback) {"use strict";
+ var index = this.callbacks.indexOf(f);
+ if (index >= 0) {
+ this.callbacks.splice(this.callbacks.indexOf(f), 1);
}
- Dispatcher.prototype.register=function(callback) {"use strict";
- this.callbacks.push(callback);
- };
- Dispatcher.prototype.unregister=function(callback) {"use strict";
- var index = this.callbacks.indexOf(f);
- if (index >= 0) {
- this.callbacks.splice(this.callbacks.indexOf(f), 1);
- }
- };
- Dispatcher.prototype.dispatch=function(payload) {"use strict";
- console.debug("dispatch", payload);
- this.callbacks.forEach(function(callback) {
- callback(payload);
- });
- };
+};
+Dispatcher.prototype.dispatch=function(payload) {"use strict";
+ console.debug("dispatch", payload);
+ this.callbacks.forEach(function(callback) {
+ callback(payload);
+ });
+};
AppDispatcher = new Dispatcher();