diff --git a/source/event_hub.ts b/source/event_hub.ts index 162f0c9..4cbe451 100644 --- a/source/event_hub.ts +++ b/source/event_hub.ts @@ -1,6 +1,7 @@ // :copyright: Copyright (c) 2016 ftrack import { v4 as uuidV4 } from "uuid"; import loglevel from "loglevel"; +import io from "./simple_socketio.js"; import { Event } from "./event.js"; import { EventServerConnectionTimeoutError, @@ -9,7 +10,7 @@ import { NotUniqueError, } from "./error.js"; import { Data } from "./types.js"; -import type io from "./simple_socketio.js"; + interface BaseActionData { selection: Array<{ entityId: string; @@ -177,9 +178,7 @@ export class EventHub { } /** Connect to the event server. */ - async connect(): Promise { - const simple_socketio = await import("./simple_socketio.js"); - const io = simple_socketio.default; + connect(): void { this._socketIo = io.connect(this._serverUrl, this._apiUser, this._apiKey); this._socketIo.on("connect", this._onSocketConnected); this._socketIo.on("ftrack.event", this._handle);