diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 00:04:10 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 00:04:10 -0700 |
commit | 9e3591e3c225c51d5a5b80eb331719d20d14dc48 (patch) | |
tree | 137afcb2916a214b642db608aab240f761665433 /web/src/js/app.js | |
parent | 9a76e31f2fb77367d6632b6b03cdfeabfadf0caf (diff) | |
download | mitmproxy-9e3591e3c225c51d5a5b80eb331719d20d14dc48.tar.gz mitmproxy-9e3591e3c225c51d5a5b80eb331719d20d14dc48.tar.bz2 mitmproxy-9e3591e3c225c51d5a5b80eb331719d20d14dc48.zip |
add basic redux architecture, convert eventlog to redux
Diffstat (limited to 'web/src/js/app.js')
-rw-r--r-- | web/src/js/app.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/web/src/js/app.js b/web/src/js/app.js index e21fa499..30897686 100644 --- a/web/src/js/app.js +++ b/web/src/js/app.js @@ -1,9 +1,15 @@ import React from "react" -import { render } from 'react-dom' +import {render} from 'react-dom' +import {createStore} from 'redux' +import {Provider} from 'react-redux' +import mitmproxyApp from './reducers' + import $ from "jquery" import Connection from "./connection" -import {app} from "./components/proxyapp.js" -import { EventLogActions } from "./actions.js" +import {App} from "./components/proxyapp.js" +import {EventLogActions} from "./actions.js" + +let store = createStore(mitmproxyApp); $(function () { window.ws = new Connection("/updates"); @@ -12,6 +18,8 @@ $(function () { EventLogActions.add_event(msg); }; - render(app, document.getElementById("mitmproxy")); + render( + <Provider store={store}>{App}</Provider>, + document.getElementById("mitmproxy")); }); |