MCPcopy Create free account
hub / github.com/TanStack/devtools / onAll

Method onAll

packages/event-bus-client/src/plugin.ts:275–292  ·  view source on GitHub ↗
(cb: (event: TanStackDevtoolsEvent<string, any>) => void)

Source from the content-addressed store, hash-verified

273 }
274
275 onAll(cb: (event: TanStackDevtoolsEvent<string, any>) => void) {
276 if (!this.#enabled) {
277 this.debugLog('Event bus client is disabled, not registering event')
278 return () => {}
279 }
280
281 const handler = (e: Event) => {
282 const event = (e as CustomEvent).detail
283
284 cb(event)
285 }
286 this.#eventTarget().addEventListener('tanstack-devtools-global', handler)
287 return () =>
288 this.#eventTarget().removeEventListener(
289 'tanstack-devtools-global',
290 handler,
291 )
292 }
293 onAllPluginEvents(cb: (event: AllDevtoolsEvents<TEventMap>) => void) {
294 if (!this.#enabled) {
295 this.debugLog('Event bus client is disabled, not registering event')

Callers 2

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

Calls 1

debugLogMethod · 0.95

Tested by

no test coverage detected