react-query-firebase 2.6.2 → 2.6.3

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,13 +5,13 @@
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",
8
+ "@react-native-firebase/analytics": "^22.1.0",
9
+ "@react-native-firebase/app": "^22.1.0",
10
+ "@react-native-firebase/auth": "^22.1.0",
11
+ "@react-native-firebase/crashlytics": "^22.1.0",
12
+ "@react-native-firebase/firestore": "^22.1.0",
13
+ "@react-native-firebase/installations": "^22.1.0",
14
+ "@react-native-firebase/remote-config": "^22.1.0",
15
15
  "@tanstack/react-query": "^5.0.0",
16
16
  "firebase": "^11.0.0",
17
17
  "react": "^18.0.0 || ^19.0.0"
@@ -22,13 +22,13 @@
22
22
  "description": "This module offers react hooks to work with Firebase on react-native and web platforms",
23
23
  "devDependencies": {
24
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",
25
+ "@react-native-firebase/analytics": "^22.1.0",
26
+ "@react-native-firebase/app": "^22.1.0",
27
+ "@react-native-firebase/auth": "^22.1.0",
28
+ "@react-native-firebase/crashlytics": "^22.1.0",
29
+ "@react-native-firebase/firestore": "^22.1.0",
30
+ "@react-native-firebase/installations": "^22.1.0",
31
+ "@react-native-firebase/remote-config": "^22.1.0",
32
32
  "@types/react": "^19.0.2",
33
33
  "husky": "^9.1.1",
34
34
  "lint-staged": "^15.1.0",
@@ -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.3"
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);
@@ -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
 
@@ -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
 
@@ -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