We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
onAllPluginEvents
1 parent 67be66c commit 5401a62Copy full SHA for 5401a62
1 file changed
packages/event-bus-client/src/plugin.ts
@@ -331,22 +331,11 @@ export class EventClient<
331
)
332
}
333
onAllPluginEvents(cb: (event: AllDevtoolsEvents<TEventMap>) => void) {
334
- if (!this.#enabled) {
335
- this.debugLog('Event bus client is disabled, not registering event')
336
- return () => {}
337
- }
338
- const handler = (e: Event) => {
339
- const event = (e as CustomEvent).detail
+ return this.onAll((event) => {
340
if (this.#pluginId && event.pluginId !== this.#pluginId) {
341
return
342
343
cb(event)
344
345
- this.#eventTarget().addEventListener('tanstack-devtools-global', handler)
346
- return () =>
347
- this.#eventTarget().removeEventListener(
348
- 'tanstack-devtools-global',
349
- handler,
350
- )
+ })
351
352
0 commit comments