diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-02-18 23:10:47 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-02-18 23:10:47 +0100 |
commit | 7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3 (patch) | |
tree | 3f583d91ff97924068f7017f770b710da2768abe /web/src/js/dispatcher.js | |
parent | be02dd105b7803b7b2b6942f9d254539dfd6ba26 (diff) | |
parent | 61cde30ef8410dc5400039eea5d312fabf3779a9 (diff) | |
download | mitmproxy-7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3.tar.gz mitmproxy-7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3.tar.bz2 mitmproxy-7c6bf7abb3c0e94f9c4dfa77fe0690fe11c6d4d3.zip |
Merge pull request #964 from mitmproxy/flat-structure
Flat structure
Diffstat (limited to 'web/src/js/dispatcher.js')
-rw-r--r-- | web/src/js/dispatcher.js | 22 |
1 files changed, 22 insertions, 0 deletions
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 |