diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-02-29 02:57:35 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-02-29 02:57:35 +0100 |
commit | 3de89ab16c320350f20c828763b11a47cf2a2807 (patch) | |
tree | 3ad523407ca1a2db6c2560ecab546c4a57c728c4 /web/src/js/connection.js | |
parent | 9192427d7b845a6389c4a44c930e067c479cdf0d (diff) | |
download | mitmproxy-3de89ab16c320350f20c828763b11a47cf2a2807.tar.gz mitmproxy-3de89ab16c320350f20c828763b11a47cf2a2807.tar.bz2 mitmproxy-3de89ab16c320350f20c828763b11a47cf2a2807.zip |
web: use es6 modules
Diffstat (limited to 'web/src/js/connection.js')
-rw-r--r-- | web/src/js/connection.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/web/src/js/connection.js b/web/src/js/connection.js index 5e229b6e..6177938e 100644 --- a/web/src/js/connection.js +++ b/web/src/js/connection.js @@ -1,6 +1,6 @@ -var actions = require("./actions.js"); -var AppDispatcher = require("./dispatcher.js").AppDispatcher; +import {ConnectionActions, EventLogActions} from "./actions.js"; +import {AppDispatcher} from "./dispatcher.js"; function Connection(url) { if (url[0] === "/") { @@ -9,21 +9,21 @@ function Connection(url) { var ws = new WebSocket(url); ws.onopen = function () { - actions.ConnectionActions.open(); + ConnectionActions.open(); }; ws.onmessage = function (message) { var m = JSON.parse(message.data); AppDispatcher.dispatchServerAction(m); }; ws.onerror = function () { - actions.ConnectionActions.error(); - actions.EventLogActions.add_event("WebSocket connection error."); + ConnectionActions.error(); + EventLogActions.add_event("WebSocket connection error."); }; ws.onclose = function () { - actions.ConnectionActions.close(); - actions.EventLogActions.add_event("WebSocket connection closed."); + ConnectionActions.close(); + EventLogActions.add_event("WebSocket connection closed."); }; return ws; } -module.exports = Connection;
\ No newline at end of file +export default Connection;
\ No newline at end of file |