← Về thư mục
frontend/src/features/ws/connect.ts
- WsSocket · type · L10-L16 — type WsSocket = { readyState: number; send: (data: string) => void; onopen: ((ev?: unknown) => void) | null; onclose: ((ev?: unknown) => void) | null; onmessage: ((ev: { data: unknown }) => void) | null; };
- WsConstructor · type · L18-L18 — type WsConstructor = new (url: string) => WsSocket;
- ConnectWS · type · L20-L20 — type ConnectWS = (() => void) & { _p?: ReturnType };
- setWebSocketImpl · function · L24-L26 — function setWebSocketImpl(ctor: WsConstructor | undefined): void
- pageLocation · function · L28-L31 — function pageLocation(): { protocol: string; host: string }
- wsUrl · function · L33-L35 — function wsUrl(loc: { protocol: string; host: string } = pageLocation()): string
- resolveWsCtor · function · L37-L43 — function resolveWsCtor(): WsConstructor
- conn · function · L45-L52 — function conn(on: boolean): void
- sub · function · L55-L71 — function sub(f: string): void
- unsub · function · L74-L83 — function unsub(f: string): void
- handleIncomingMessage · function · L92-L104 — function handleIncomingMessage(data: unknown): void
- connectWS · function · L106-L128 — connectWS: ConnectWS = ()
- clearWsPing · function · L130-L133 — function clearWsPing(): void