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

Method onAllPluginEvents

packages/event-bus-client/src/plugin.ts:293–311  ·  view source on GitHub ↗
(cb: (event: AllDevtoolsEvents<TEventMap>) => void)

Source from the content-addressed store, hash-verified

291 )
292 }
293 onAllPluginEvents(cb: (event: AllDevtoolsEvents<TEventMap>) => void) {
294 if (!this.#enabled) {
295 this.debugLog('Event bus client is disabled, not registering event')
296 return () => {}
297 }
298 const handler = (e: Event) => {
299 const event = (e as CustomEvent).detail
300 if (this.#pluginId && event.pluginId !== this.#pluginId) {
301 return
302 }
303 cb(event)
304 }
305 this.#eventTarget().addEventListener('tanstack-devtools-global', handler)
306 return () =>
307 this.#eventTarget().removeEventListener(
308 'tanstack-devtools-global',
309 handler,
310 )
311 }
312}

Callers 2

index.test.tsFile · 0.45
noop.test.tsFile · 0.45

Calls 1

debugLogMethod · 0.95

Tested by

no test coverage detected