diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 21:12:59 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-06-02 21:12:59 -0700 |
commit | 7c63aa3708a09b997575cb85cb6dfaaa41082fab (patch) | |
tree | f785caa03b667fb38487575ae7030e9e46bbd84d /web/src/js/app.js | |
parent | 6a91ab166f4479eb50846fed184aa197dd018bfe (diff) | |
download | mitmproxy-7c63aa3708a09b997575cb85cb6dfaaa41082fab.tar.gz mitmproxy-7c63aa3708a09b997575cb85cb6dfaaa41082fab.tar.bz2 mitmproxy-7c63aa3708a09b997575cb85cb6dfaaa41082fab.zip |
web: reduxify WebSocket
Diffstat (limited to 'web/src/js/app.js')
-rw-r--r-- | web/src/js/app.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/web/src/js/app.js b/web/src/js/app.js index 5b5d1fc8..f631b2c5 100644 --- a/web/src/js/app.js +++ b/web/src/js/app.js @@ -3,7 +3,6 @@ import {render} from 'react-dom' import {createStore} from 'redux' import {Provider} from 'react-redux' -import $ from "jquery" import Connection from "./connection" import {App} from "./components/proxyapp.js" import {EventLogActions} from "./actions.js" @@ -11,8 +10,8 @@ import rootReducer from './ducks/index'; let store = createStore(rootReducer); -$(function () { - window.ws = new Connection("/updates"); +document.addEventListener('DOMContentLoaded', () => { + window.ws = new Connection("/updates", store.dispatch); window.onerror = function (msg) { EventLogActions.add_event(msg); @@ -20,6 +19,7 @@ $(function () { render( <Provider store={store}>{App}</Provider>, - document.getElementById("mitmproxy")); -}); + document.getElementById("mitmproxy") + ); +}); |