({
port = 4206,
host = 'localhost',
protocol = 'http',
debug = false,
connectToServerBus = false,
}: ClientEventBusConfig = {})
| 89 | this.#eventTarget.dispatchEvent(new CustomEvent('tanstack-connect-success')) |
| 90 | } |
| 91 | constructor({ |
| 92 | port = 4206, |
| 93 | host = 'localhost', |
| 94 | protocol = 'http', |
| 95 | debug = false, |
| 96 | connectToServerBus = false, |
| 97 | }: ClientEventBusConfig = {}) { |
| 98 | this.#debug = debug |
| 99 | this.#broadcastChannel = new BroadcastChannel('tanstack-devtools') |
| 100 | this.#eventSource = null |
| 101 | this.#port = getDefaultPort(port) |
| 102 | this.#host = getDefaultHost(host) |
| 103 | this.#protocol = getDefaultProtocol(protocol) |
| 104 | this.#socket = null |
| 105 | this.#connectToServerBus = connectToServerBus |
| 106 | this.#eventTarget = this.getGlobalTarget() |
| 107 | this.#broadcastChannel.onmessage = (e) => { |
| 108 | this.emitToClients(parseWithBigInt(e.data), true) |
| 109 | } |
| 110 | this.debugLog('Initializing client event bus') |
| 111 | } |
| 112 | |
| 113 | private emitToClients( |
| 114 | event: TanStackDevtoolsEvent<string>, |
nothing calls this directly
no test coverage detected