File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
packages/query-broadcast-client-experimental/src Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ interface broadcastQueryClient {
4747 /** This is the unique channel name that will be used
4848 * to communicate between tabs and windows */
4949 broadcastChannel? : string
50+ /** Options for the BroadcastChannel API */
51+ options? : BroadcastChannelOptions
5052}
5153```
5254
Original file line number Diff line number Diff line change 11import { BroadcastChannel } from 'broadcast-channel'
2+ import type { BroadcastChannelOptions } from 'broadcast-channel'
23import type { QueryClient } from '@tanstack/query-core'
34
45interface BroadcastQueryClientOptions {
56 queryClient : QueryClient
67 broadcastChannel ?: string
8+ options ?: BroadcastChannelOptions
79}
810
911export function broadcastQueryClient ( {
1012 queryClient,
1113 broadcastChannel = 'tanstack-query' ,
14+ options,
1215} : BroadcastQueryClientOptions ) {
1316 let transaction = false
1417 const tx = ( cb : ( ) => void ) => {
@@ -19,6 +22,7 @@ export function broadcastQueryClient({
1922
2023 const channel = new BroadcastChannel ( broadcastChannel , {
2124 webWorkerSupport : false ,
25+ ...options ,
2226 } )
2327
2428 const queryCache = queryClient . getQueryCache ( )
You can’t perform that action at this time.
0 commit comments