File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
src/queryCore/broadcastQueryClient-experimental
storybook/stories/queries Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
- import { BroadcastChannel } from 'broadcast-channel'
2
1
import { QueryClient } from '../core'
3
2
4
3
interface BroadcastQueryClientOptions {
5
4
queryClient : QueryClient
6
5
broadcastChannel ?: string
7
6
}
8
7
9
- export function broadcastQueryClient ( {
8
+ export async function broadcastQueryClient ( {
10
9
queryClient,
11
10
broadcastChannel = 'svelte-query' ,
12
11
} : BroadcastQueryClientOptions ) {
12
+ const { BroadcastChannel } = await import ( 'broadcast-channel' )
13
+
13
14
let transaction = false
14
15
const tx = ( cb : ( ) => void ) => {
15
16
transaction = true
Original file line number Diff line number Diff line change 20
20
{ queryKey: ' myQuery3' , queryFn: queryFn3 },
21
21
] as const
22
22
23
- const queriesStore = useQueries (queries )
23
+ const queriesStore = useQueries <
24
+ [{ queryFnData: string }, { queryFnData: string }, { queryFnData: boolean }]
25
+ > (queries )
26
+ // TS Error
27
+ // const queriesStore = useQueries<
28
+ // [{ queryFnData: string }, { queryFnData: string }, { queryFnData: string }]
29
+ // >(queries)
30
+ // can pass only TData (data prop) although TQueryFnData will be left unknown
31
+ // Please see QueriesOptions for more details
24
32
</script >
25
33
26
34
<main >
You can’t perform that action at this time.
0 commit comments