File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/event-bus/src/client Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @tanstack/devtools-event-bus ' : patch
3+ ---
4+
5+ fix issue with broadcast channel not emitting functions properly and failing
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export class ClientEventBus {
5555 this . #connectToServerBus = connectToServerBus
5656 this . #eventTarget = this . getGlobalTarget ( )
5757 this . #broadcastChannel. onmessage = ( e ) => {
58- this . emitToClients ( e . data , true )
58+ this . emitToClients ( JSON . parse ( e . data ) , true )
5959 }
6060 this . debugLog ( 'Initializing client event bus' )
6161 }
@@ -74,7 +74,7 @@ export class ClientEventBus {
7474 // We only emit the events if they didn't come from the broadcast channel
7575 // otherwise it would infinitely send events between
7676 if ( ! fromBroadcastChannel ) {
77- this . #broadcastChannel?. postMessage ( event )
77+ this . #broadcastChannel?. postMessage ( JSON . stringify ( event ) )
7878 }
7979 this . debugLog ( 'Emitting event to global client listeners' , event )
8080 this . #eventTarget. dispatchEvent ( globalEvent )
You can’t perform that action at this time.
0 commit comments