diff options
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 |