aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/web/src/js/dispatcher.js
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/web/src/js/dispatcher.js')
-rw-r--r--mitmproxy/web/src/js/dispatcher.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/mitmproxy/web/src/js/dispatcher.js b/mitmproxy/web/src/js/dispatcher.js
new file mode 100644
index 00000000..0c2aa202
--- /dev/null
+++ b/mitmproxy/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