react-query-firebase 2.6.2 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -5,41 +5,41 @@
5
5
  "url": "https://github.com/vpishuk/react-query-firebase/issues"
6
6
  },
7
7
  "peerDependencies": {
8
- "@react-native-firebase/analytics": "^21.0.0",
9
- "@react-native-firebase/app": "^21.0.0",
10
- "@react-native-firebase/auth": "^21.0.0",
11
- "@react-native-firebase/crashlytics": "^21.0.0",
12
- "@react-native-firebase/firestore": "^21.0.0",
13
- "@react-native-firebase/installations": "^21.0.0",
14
- "@react-native-firebase/remote-config": "^21.0.0",
15
- "@tanstack/react-query": "^5.0.0",
16
- "firebase": "^11.0.0",
17
- "react": "^18.0.0 || ^19.0.0"
8
+ "@react-native-firebase/analytics": "^22.x.x",
9
+ "@react-native-firebase/app": "^22.x.x",
10
+ "@react-native-firebase/auth": "^22.x.x",
11
+ "@react-native-firebase/crashlytics": "^22.x.x",
12
+ "@react-native-firebase/firestore": "^22.x.x",
13
+ "@react-native-firebase/installations": "^22.x.x",
14
+ "@react-native-firebase/remote-config": "^22.x.x",
15
+ "@tanstack/react-query": "^5.x.x",
16
+ "firebase": "^11.x.x",
17
+ "react": "^18.x.x || ^19.x.x"
18
18
  },
19
19
  "publishConfig": {
20
20
  "access": "public"
21
21
  },
22
22
  "description": "This module offers react hooks to work with Firebase on react-native and web platforms",
23
23
  "devDependencies": {
24
- "@laverve/eslint-utils": "^5.1.1",
25
- "@react-native-firebase/analytics": "^21.0.0",
26
- "@react-native-firebase/app": "^21.0.0",
27
- "@react-native-firebase/auth": "^21.0.0",
28
- "@react-native-firebase/crashlytics": "^21.0.0",
29
- "@react-native-firebase/firestore": "^21.0.0",
30
- "@react-native-firebase/installations": "^21.0.0",
31
- "@react-native-firebase/remote-config": "^21.0.0",
32
- "@types/react": "^19.0.2",
33
- "husky": "^9.1.1",
34
- "lint-staged": "^15.1.0",
35
- "prettier": "^3.0.3",
36
- "react": "^19.0.0",
37
- "typedoc": "^0.28.0",
38
- "typedoc-plugin-markdown": "^4.4.1",
24
+ "@laverve/eslint-utils": "^5.3.1",
25
+ "@react-native-firebase/analytics": "^22.2.1",
26
+ "@react-native-firebase/app": "^22.2.1",
27
+ "@react-native-firebase/auth": "^22.2.1",
28
+ "@react-native-firebase/crashlytics": "^22.2.1",
29
+ "@react-native-firebase/firestore": "^22.2.1",
30
+ "@react-native-firebase/installations": "^22.2.1",
31
+ "@react-native-firebase/remote-config": "^22.2.1",
32
+ "@types/react": "^19.1.7",
33
+ "husky": "^9.1.7",
34
+ "lint-staged": "^16.1.0",
35
+ "prettier": "^3.5.3",
36
+ "react": "^19.1.0",
37
+ "typedoc": "^0.28.5",
38
+ "typedoc-plugin-markdown": "^4.6.4",
39
39
  "typedoc-vitepress-theme": "^1.1.2",
40
- "typescript": "^5.2.2",
41
- "vitepress": "^1.5.0",
42
- "firebase": "^11.0.1"
40
+ "typescript": "^5.8.3",
41
+ "vitepress": "^1.6.3",
42
+ "firebase": "^11.9.0"
43
43
  },
44
44
  "homepage": "https://github.com/vpishuk/react-query-firebase",
45
45
  "keywords": [
@@ -74,5 +74,5 @@
74
74
  "docs:build": "vitepress build docs",
75
75
  "docs:preview": "vitepress preview docs"
76
76
  },
77
- "version": "2.6.2"
77
+ "version": "2.6.4"
78
78
  }
@@ -63,7 +63,7 @@ export const useIdToken = (): UseIdTokenResult => {
63
63
  }, [callback]);
64
64
 
65
65
  useEffect(() => {
66
- const unsubscribe = onIdTokenChanged(auth, (user: FirebaseAuthTypes.User) => {
66
+ const unsubscribe = onIdTokenChanged(auth, (user: FirebaseAuthTypes.User | null) => {
67
67
  if (user) {
68
68
  user.getIdToken().then((idToken) => {
69
69
  setIdToken(idToken);
@@ -37,4 +37,4 @@ export type UseEnsureDocOptions<AppModelType extends AppModel = AppModel> = {
37
37
  * };
38
38
  * ```
39
39
  */
40
- export declare const useEnsureDoc: <AppModelType extends AppModel = AppModel>({ reference, path, pathSegments, defaults, options }: UseEnsureDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<AppModelType, Error>;
40
+ export declare const useEnsureDoc: <AppModelType extends AppModel = AppModel>({ reference, path, pathSegments, defaults, options }: UseEnsureDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<import("@tanstack/react-query").NoInfer<AppModelType>, Error>;
@@ -32,7 +32,7 @@ export const useEnsureDoc = ({ reference, path, pathSegments, defaults, options
32
32
  ...options,
33
33
  queryFn: async () => {
34
34
  const existingDocSnap = await getDocSnap({ db, path, pathSegments, reference });
35
- if (existingDocSnap?.exists) {
35
+ if (existingDocSnap?.exists()) {
36
36
  return { ...existingDocSnap.data(), uid: existingDocSnap.id };
37
37
  }
38
38
  const docRef = getDocRef({ db, reference, path, pathSegments });
@@ -60,7 +60,7 @@ export const useEnsureDoc = <AppModelType extends AppModel = AppModel>({
60
60
  queryFn: async () => {
61
61
  const existingDocSnap = await getDocSnap({ db, path, pathSegments, reference });
62
62
 
63
- if (existingDocSnap?.exists) {
63
+ if (existingDocSnap?.exists()) {
64
64
  return { ...(existingDocSnap.data() as AppModelType), uid: existingDocSnap.id };
65
65
  }
66
66
 
@@ -33,5 +33,5 @@ type UseGetDocOptions<AppModelType extends AppModel = AppModel> = {
33
33
  * };
34
34
  * ```
35
35
  */
36
- export declare const useGetDocData: <AppModelType extends AppModel = AppModel>({ options, reference, path, pathSegments }: UseGetDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<AppModelType, Error>;
36
+ export declare const useGetDocData: <AppModelType extends AppModel = AppModel>({ options, reference, path, pathSegments }: UseGetDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<import("@tanstack/react-query").NoInfer<AppModelType>, Error>;
37
37
  export {};
@@ -9,7 +9,7 @@ type UseInfiniteQueryOptions<AppModelType extends AppModel = AppModel, TQueryKey
9
9
  /**
10
10
  * Reqct-query options that must include queryKey and shall not define queryFn
11
11
  */
12
- options: Omit<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, AppModelType[], TQueryKey, QueryNonFilterConstraint>, "queryFn"> & Required<Pick<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, AppModelType[], TQueryKey, QueryNonFilterConstraint>, "queryKey">>;
12
+ options: Omit<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, TQueryKey, QueryNonFilterConstraint>, "queryFn"> & Required<Pick<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, TQueryKey, QueryNonFilterConstraint>, "queryKey">>;
13
13
  /**
14
14
  * Reference to a Firestore collection
15
15
  */
@@ -28,7 +28,6 @@ type UseInfiniteQueryOptions<AppModelType extends AppModel = AppModel, TQueryKey
28
28
  AppModelType[],
29
29
  Error,
30
30
  InfiniteData<AppModelType[]>,
31
- AppModelType[],
32
31
  TQueryKey,
33
32
  QueryNonFilterConstraint
34
33
  >,
@@ -40,7 +39,6 @@ type UseInfiniteQueryOptions<AppModelType extends AppModel = AppModel, TQueryKey
40
39
  AppModelType[],
41
40
  Error,
42
41
  InfiniteData<AppModelType[]>,
43
- AppModelType[],
44
42
  TQueryKey,
45
43
  QueryNonFilterConstraint
46
44
  >,
@@ -12,7 +12,7 @@ import { getDocSnap } from "./getDocSnap";
12
12
  */
13
13
  export const getDocData = async ({ db, reference, path, pathSegments }) => {
14
14
  const docSnap = await getDocSnap({ db, reference, path, pathSegments });
15
- if (docSnap && docSnap?.exists) {
15
+ if (docSnap && docSnap?.exists()) {
16
16
  return { ...docSnap.data(), uid: docSnap.id };
17
17
  }
18
18
  return null;
@@ -25,7 +25,7 @@ export const getDocData = async <AppModelType extends AppModel = AppModel>({
25
25
  }: GetDocDataOptions<AppModelType>) => {
26
26
  const docSnap = await getDocSnap<AppModelType>({ db, reference, path, pathSegments });
27
27
 
28
- if (docSnap && docSnap?.exists) {
28
+ if (docSnap && docSnap?.exists()) {
29
29
  return { ...docSnap.data(), uid: docSnap.id } as AppModelType;
30
30
  }
31
31
 
@@ -37,4 +37,4 @@ export type UseEnsureDocOptions<AppModelType extends AppModel = AppModel> = {
37
37
  * };
38
38
  * ```
39
39
  */
40
- export declare const useEnsureDoc: <AppModelType extends AppModel = AppModel>({ reference, path, pathSegments, defaults, options }: UseEnsureDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<AppModelType, Error>;
40
+ export declare const useEnsureDoc: <AppModelType extends AppModel = AppModel>({ reference, path, pathSegments, defaults, options }: UseEnsureDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<import("@tanstack/react-query").NoInfer<AppModelType>, Error>;
@@ -42,7 +42,7 @@ export const useEnsureDoc = ({ reference, path, pathSegments, defaults, options
42
42
  };
43
43
  try {
44
44
  const existingDocSnap = await getDocSnap({ db, path, pathSegments, reference });
45
- if (existingDocSnap?.exists) {
45
+ if (existingDocSnap?.exists()) {
46
46
  return { ...existingDocSnap.data(), uid: existingDocSnap.id };
47
47
  }
48
48
  return createDoc();
@@ -74,7 +74,7 @@ export const useEnsureDoc = <AppModelType extends AppModel = AppModel>({
74
74
  try {
75
75
  const existingDocSnap = await getDocSnap({ db, path, pathSegments, reference });
76
76
 
77
- if (existingDocSnap?.exists) {
77
+ if (existingDocSnap?.exists()) {
78
78
  return { ...(existingDocSnap.data() as AppModelType), uid: existingDocSnap.id };
79
79
  }
80
80
 
@@ -33,5 +33,5 @@ type UseGetDocOptions<AppModelType extends AppModel = AppModel> = {
33
33
  * };
34
34
  * ```
35
35
  */
36
- export declare const useGetDocData: <AppModelType extends AppModel = AppModel>({ options, reference, path, pathSegments }: UseGetDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<AppModelType, Error>;
36
+ export declare const useGetDocData: <AppModelType extends AppModel = AppModel>({ options, reference, path, pathSegments }: UseGetDocOptions<AppModelType>) => import("@tanstack/react-query").UseQueryResult<import("@tanstack/react-query").NoInfer<AppModelType>, Error>;
37
37
  export {};
@@ -9,7 +9,7 @@ type UseInfiniteQueryOptions<AppModelType extends AppModel = AppModel, TQueryKey
9
9
  /**
10
10
  * Reqct-query options that must include queryKey and shall not define queryFn
11
11
  */
12
- options: Omit<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, AppModelType[], TQueryKey, QueryNonFilterConstraint>, "queryFn"> & Required<Pick<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, AppModelType[], TQueryKey, QueryNonFilterConstraint>, "queryKey">>;
12
+ options: Omit<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, TQueryKey, QueryNonFilterConstraint>, "queryFn"> & Required<Pick<UseReactInfiniteQueryOptions<AppModelType[], Error, InfiniteData<AppModelType[]>, TQueryKey, QueryNonFilterConstraint>, "queryKey">>;
13
13
  /**
14
14
  * Reference to a Firestore collection
15
15
  */
@@ -29,7 +29,6 @@ type UseInfiniteQueryOptions<AppModelType extends AppModel = AppModel, TQueryKey
29
29
  AppModelType[],
30
30
  Error,
31
31
  InfiniteData<AppModelType[]>,
32
- AppModelType[],
33
32
  TQueryKey,
34
33
  QueryNonFilterConstraint
35
34
  >,
@@ -41,7 +40,6 @@ type UseInfiniteQueryOptions<AppModelType extends AppModel = AppModel, TQueryKey
41
40
  AppModelType[],
42
41
  Error,
43
42
  InfiniteData<AppModelType[]>,
44
- AppModelType[],
45
43
  TQueryKey,
46
44
  QueryNonFilterConstraint
47
45
  >,