1- import { InitialDataFunction , type UseQueryOptions , useQuery } from "@tanstack/react-query" ;
1+ import {
2+ type InitialDataFunction ,
3+ type UseQueryOptions ,
4+ useQuery ,
5+ } from "@tanstack/react-query" ;
26import type { FirebaseError } from "firebase/app" ;
37import {
48 type CallerSdkType ,
@@ -20,15 +24,13 @@ export type useDataConnectQueryOptions<
2024> = PartialBy < Omit < UseQueryOptions < TData , TError > , "queryFn" > , "queryKey" > ;
2125
2226export function useDataConnectQuery < Data = unknown , Variables = unknown > (
23- refOrResult : QueryRef < Data , Variables >
24- | QueryResult < Data , Variables > ,
25- options ?: useDataConnectQueryOptions <
26- Data ,
27- FirebaseError
28- > ,
29- _callerSdkType : CallerSdkType = CallerSdkTypeEnum . TanstackReactCore
27+ refOrResult : QueryRef < Data , Variables > | QueryResult < Data , Variables > ,
28+ options ?: useDataConnectQueryOptions < Data , FirebaseError > ,
29+ _callerSdkType : CallerSdkType = CallerSdkTypeEnum . TanstackReactCore ,
3030) : UseDataConnectQueryResult < Data , Variables > {
31- const [ dataConnectResult , setDataConnectResult ] = useState < QueryResultRequiredRef < Data , Variables > > ( 'ref' in refOrResult ? refOrResult : { ref : refOrResult } ) ;
31+ const [ dataConnectResult , setDataConnectResult ] = useState <
32+ QueryResultRequiredRef < Data , Variables >
33+ > ( "ref" in refOrResult ? refOrResult : { ref : refOrResult } ) ;
3234 // TODO(mtewani): in the future we should allow for users to pass in `QueryResult` objects into `initialData`.
3335 let initialData : Data | InitialDataFunction < Data > | undefined ;
3436 const { ref } = dataConnectResult ;
0 commit comments