From 18b619e164ced91cf0ac8d3fd3c18be1f07df1cc Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 18 Feb 2016 12:29:35 +0100 Subject: move mitmproxy/web to root --- web/src/js/dispatcher.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 web/src/js/dispatcher.js (limited to 'web/src/js/dispatcher.js') diff --git a/web/src/js/dispatcher.js b/web/src/js/dispatcher.js new file mode 100644 index 00000000..0c2aa202 --- /dev/null +++ b/web/src/js/dispatcher.js @@ -0,0 +1,22 @@ + +var flux = require("flux"); + +const PayloadSources = { + VIEW: "view", + SERVER: "server" +}; + + +var AppDispatcher = new flux.Dispatcher(); +AppDispatcher.dispatchViewAction = function (action) { + action.source = PayloadSources.VIEW; + this.dispatch(action); +}; +AppDispatcher.dispatchServerAction = function (action) { + action.source = PayloadSources.SERVER; + this.dispatch(action); +}; + +module.exports = { + AppDispatcher: AppDispatcher +}; \ No newline at end of file -- cgit v1.2.3