MCPcopy Index your code
hub / github.com/TanStack/devtools / constructor

Method constructor

packages/event-bus/src/client/client.ts:91–111  ·  view source on GitHub ↗
({
    port = 4206,
    host = 'localhost',
    protocol = 'http',
    debug = false,
    connectToServerBus = false,
  }: ClientEventBusConfig = {})

Source from the content-addressed store, hash-verified

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>,

Callers

nothing calls this directly

Calls 7

getGlobalTargetMethod · 0.95
emitToClientsMethod · 0.95
debugLogMethod · 0.95
parseWithBigIntFunction · 0.90
getDefaultPortFunction · 0.85
getDefaultHostFunction · 0.85
getDefaultProtocolFunction · 0.85

Tested by

no test coverage detected