react-query-firebase 2.0.2 → 2.1.0

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.
Files changed (179) hide show
  1. package/package.json +2 -2
  2. package/react-native/firestore/index.ts +1 -0
  3. package/react-native/firestore/useCompositeFilter.ts +4 -4
  4. package/react-native/firestore/useQueryConstraints.ts +84 -0
  5. package/react-native/index.d.ts +0 -4
  6. package/react-native/index.js +0 -4
  7. package/react-native/index.ts +0 -4
  8. package/web/firestore/index.ts +1 -0
  9. package/web/firestore/useCompositeFilter.ts +4 -4
  10. package/web/firestore/useQueryConstraints.ts +93 -0
  11. package/web/index.d.ts +0 -4
  12. package/web/index.js +0 -4
  13. package/web/index.ts +0 -4
  14. package/react-native/analytics/index.d.ts +0 -3
  15. package/react-native/analytics/index.js +0 -3
  16. package/react-native/analytics/useAnalytics.d.ts +0 -5
  17. package/react-native/analytics/useAnalytics.js +0 -10
  18. package/react-native/analytics/useLogEvent.d.ts +0 -17
  19. package/react-native/analytics/useLogEvent.js +0 -21
  20. package/react-native/analytics/useSetAnalyticsCollectionEnabled.d.ts +0 -10
  21. package/react-native/analytics/useSetAnalyticsCollectionEnabled.js +0 -16
  22. package/react-native/auth/index.d.ts +0 -12
  23. package/react-native/auth/index.js +0 -12
  24. package/react-native/auth/mutation-keys.d.ts +0 -7
  25. package/react-native/auth/mutation-keys.js +0 -19
  26. package/react-native/auth/useAuth.d.ts +0 -5
  27. package/react-native/auth/useAuth.js +0 -10
  28. package/react-native/auth/useCreateUserWitEmailAndPasswordMutation.d.ts +0 -15
  29. package/react-native/auth/useCreateUserWitEmailAndPasswordMutation.js +0 -19
  30. package/react-native/auth/useCurrentUser.d.ts +0 -6
  31. package/react-native/auth/useCurrentUser.js +0 -20
  32. package/react-native/auth/useIdToken.d.ts +0 -30
  33. package/react-native/auth/useIdToken.js +0 -66
  34. package/react-native/auth/useReauthenticateWitCredentialMutation.d.ts +0 -16
  35. package/react-native/auth/useReauthenticateWitCredentialMutation.js +0 -18
  36. package/react-native/auth/useReauthenticateWitRedirectMutation.d.ts +0 -17
  37. package/react-native/auth/useReauthenticateWitRedirectMutation.js +0 -18
  38. package/react-native/auth/useSendEmailVerificationMutation.d.ts +0 -13
  39. package/react-native/auth/useSendEmailVerificationMutation.js +0 -16
  40. package/react-native/auth/useSignInWitEmailAndPasswordMutation.d.ts +0 -15
  41. package/react-native/auth/useSignInWitEmailAndPasswordMutation.js +0 -19
  42. package/react-native/auth/useSignInWitRedirectMutation.d.ts +0 -14
  43. package/react-native/auth/useSignInWitRedirectMutation.js +0 -18
  44. package/react-native/auth/useSignOutMutation.d.ts +0 -10
  45. package/react-native/auth/useSignOutMutation.js +0 -19
  46. package/react-native/auth/useUpdateProfileMutation.d.ts +0 -15
  47. package/react-native/auth/useUpdateProfileMutation.js +0 -17
  48. package/react-native/firestore/index.d.ts +0 -16
  49. package/react-native/firestore/index.js +0 -16
  50. package/react-native/firestore/useAddDocMutation.d.ts +0 -21
  51. package/react-native/firestore/useAddDocMutation.js +0 -25
  52. package/react-native/firestore/useBatchWrite.d.ts +0 -15
  53. package/react-native/firestore/useBatchWrite.js +0 -21
  54. package/react-native/firestore/useCollectionReference.d.ts +0 -18
  55. package/react-native/firestore/useCollectionReference.js +0 -22
  56. package/react-native/firestore/useCompositeFilter.d.ts +0 -32
  57. package/react-native/firestore/useCompositeFilter.js +0 -42
  58. package/react-native/firestore/useCountQuery.d.ts +0 -23
  59. package/react-native/firestore/useCountQuery.js +0 -30
  60. package/react-native/firestore/useDeleteDocMutation.d.ts +0 -18
  61. package/react-native/firestore/useDeleteDocMutation.js +0 -23
  62. package/react-native/firestore/useDocReference.d.ts +0 -19
  63. package/react-native/firestore/useDocReference.js +0 -36
  64. package/react-native/firestore/useDocReferences.d.ts +0 -23
  65. package/react-native/firestore/useDocReferences.js +0 -29
  66. package/react-native/firestore/useFirestore.d.ts +0 -7
  67. package/react-native/firestore/useFirestore.js +0 -12
  68. package/react-native/firestore/useGetDocData.d.ts +0 -18
  69. package/react-native/firestore/useGetDocData.js +0 -18
  70. package/react-native/firestore/useGetRealtimeDocData.d.ts +0 -57
  71. package/react-native/firestore/useGetRealtimeDocData.js +0 -56
  72. package/react-native/firestore/useInfiniteQuery.d.ts +0 -17
  73. package/react-native/firestore/useInfiniteQuery.js +0 -28
  74. package/react-native/firestore/useQuery.d.ts +0 -24
  75. package/react-native/firestore/useQuery.js +0 -34
  76. package/react-native/firestore/useRunTransaction.d.ts +0 -15
  77. package/react-native/firestore/useRunTransaction.js +0 -19
  78. package/react-native/firestore/useSetDocMutation.d.ts +0 -20
  79. package/react-native/firestore/useSetDocMutation.js +0 -25
  80. package/react-native/firestore/useUpdateDocMutation.d.ts +0 -30
  81. package/react-native/firestore/useUpdateDocMutation.js +0 -37
  82. package/react-native/firestore/utils/getDocData.d.ts +0 -18
  83. package/react-native/firestore/utils/getDocData.js +0 -22
  84. package/react-native/firestore/utils/getDocRef.d.ts +0 -19
  85. package/react-native/firestore/utils/getDocRef.js +0 -21
  86. package/react-native/firestore/utils/getDocSnap.d.ts +0 -20
  87. package/react-native/firestore/utils/getDocSnap.js +0 -25
  88. package/react-native/remoteConfig/index.d.ts +0 -3
  89. package/react-native/remoteConfig/index.js +0 -3
  90. package/react-native/remoteConfig/useFetchAndActivate.d.ts +0 -11
  91. package/react-native/remoteConfig/useFetchAndActivate.js +0 -31
  92. package/react-native/remoteConfig/useGetValue.d.ts +0 -7
  93. package/react-native/remoteConfig/useGetValue.js +0 -15
  94. package/react-native/remoteConfig/useRemoteConfig.d.ts +0 -5
  95. package/react-native/remoteConfig/useRemoteConfig.js +0 -10
  96. package/web/analytics/index.d.ts +0 -3
  97. package/web/analytics/index.js +0 -3
  98. package/web/analytics/useAnalytics.d.ts +0 -5
  99. package/web/analytics/useAnalytics.js +0 -10
  100. package/web/analytics/useLogEvent.d.ts +0 -17
  101. package/web/analytics/useLogEvent.js +0 -21
  102. package/web/analytics/useSetAnalyticsCollectionEnabled.d.ts +0 -10
  103. package/web/analytics/useSetAnalyticsCollectionEnabled.js +0 -16
  104. package/web/auth/index.d.ts +0 -13
  105. package/web/auth/index.js +0 -13
  106. package/web/auth/mutation-keys.d.ts +0 -7
  107. package/web/auth/mutation-keys.js +0 -19
  108. package/web/auth/useAuth.d.ts +0 -5
  109. package/web/auth/useAuth.js +0 -10
  110. package/web/auth/useAuthStateReady.d.ts +0 -6
  111. package/web/auth/useAuthStateReady.js +0 -19
  112. package/web/auth/useCreateUserWitEmailAndPasswordMutation.d.ts +0 -15
  113. package/web/auth/useCreateUserWitEmailAndPasswordMutation.js +0 -19
  114. package/web/auth/useCurrentUser.d.ts +0 -6
  115. package/web/auth/useCurrentUser.js +0 -20
  116. package/web/auth/useIdToken.d.ts +0 -30
  117. package/web/auth/useIdToken.js +0 -66
  118. package/web/auth/useReauthenticateWitCredentialMutation.d.ts +0 -16
  119. package/web/auth/useReauthenticateWitCredentialMutation.js +0 -18
  120. package/web/auth/useReauthenticateWitRedirectMutation.d.ts +0 -17
  121. package/web/auth/useReauthenticateWitRedirectMutation.js +0 -18
  122. package/web/auth/useSendEmailVerificationMutation.d.ts +0 -13
  123. package/web/auth/useSendEmailVerificationMutation.js +0 -16
  124. package/web/auth/useSignInWitEmailAndPasswordMutation.d.ts +0 -15
  125. package/web/auth/useSignInWitEmailAndPasswordMutation.js +0 -19
  126. package/web/auth/useSignInWitRedirectMutation.d.ts +0 -14
  127. package/web/auth/useSignInWitRedirectMutation.js +0 -18
  128. package/web/auth/useSignOutMutation.d.ts +0 -10
  129. package/web/auth/useSignOutMutation.js +0 -19
  130. package/web/auth/useUpdateProfileMutation.d.ts +0 -15
  131. package/web/auth/useUpdateProfileMutation.js +0 -17
  132. package/web/firestore/index.d.ts +0 -16
  133. package/web/firestore/index.js +0 -16
  134. package/web/firestore/useAddDocMutation.d.ts +0 -23
  135. package/web/firestore/useAddDocMutation.js +0 -26
  136. package/web/firestore/useBatchWrite.d.ts +0 -15
  137. package/web/firestore/useBatchWrite.js +0 -21
  138. package/web/firestore/useCollectionReference.d.ts +0 -18
  139. package/web/firestore/useCollectionReference.js +0 -24
  140. package/web/firestore/useCompositeFilter.d.ts +0 -32
  141. package/web/firestore/useCompositeFilter.js +0 -41
  142. package/web/firestore/useCountQuery.d.ts +0 -23
  143. package/web/firestore/useCountQuery.js +0 -30
  144. package/web/firestore/useDeleteDocMutation.d.ts +0 -18
  145. package/web/firestore/useDeleteDocMutation.js +0 -23
  146. package/web/firestore/useDocReference.d.ts +0 -19
  147. package/web/firestore/useDocReference.js +0 -45
  148. package/web/firestore/useDocReferences.d.ts +0 -23
  149. package/web/firestore/useDocReferences.js +0 -31
  150. package/web/firestore/useFirestore.d.ts +0 -7
  151. package/web/firestore/useFirestore.js +0 -12
  152. package/web/firestore/useGetDocData.d.ts +0 -18
  153. package/web/firestore/useGetDocData.js +0 -18
  154. package/web/firestore/useGetRealtimeDocData.d.ts +0 -57
  155. package/web/firestore/useGetRealtimeDocData.js +0 -56
  156. package/web/firestore/useInfiniteQuery.d.ts +0 -18
  157. package/web/firestore/useInfiniteQuery.js +0 -28
  158. package/web/firestore/useQuery.d.ts +0 -25
  159. package/web/firestore/useQuery.js +0 -34
  160. package/web/firestore/useRunTransaction.d.ts +0 -15
  161. package/web/firestore/useRunTransaction.js +0 -19
  162. package/web/firestore/useSetDocMutation.d.ts +0 -20
  163. package/web/firestore/useSetDocMutation.js +0 -25
  164. package/web/firestore/useUpdateDocMutation.d.ts +0 -31
  165. package/web/firestore/useUpdateDocMutation.js +0 -37
  166. package/web/firestore/utils/getDocData.d.ts +0 -18
  167. package/web/firestore/utils/getDocData.js +0 -22
  168. package/web/firestore/utils/getDocRef.d.ts +0 -19
  169. package/web/firestore/utils/getDocRef.js +0 -25
  170. package/web/firestore/utils/getDocSnap.d.ts +0 -20
  171. package/web/firestore/utils/getDocSnap.js +0 -25
  172. package/web/remoteConfig/index.d.ts +0 -3
  173. package/web/remoteConfig/index.js +0 -3
  174. package/web/remoteConfig/useFetchAndActivate.d.ts +0 -11
  175. package/web/remoteConfig/useFetchAndActivate.js +0 -31
  176. package/web/remoteConfig/useGetValue.d.ts +0 -7
  177. package/web/remoteConfig/useGetValue.js +0 -15
  178. package/web/remoteConfig/useRemoteConfig.d.ts +0 -5
  179. package/web/remoteConfig/useRemoteConfig.js +0 -10
@@ -1,31 +0,0 @@
1
- import { useRemoteConfig } from "./useRemoteConfig";
2
- import { ensureInitialized, fetchAndActivate } from "firebase/remote-config";
3
- import { useCallback, useMemo, useState } from "react";
4
- /**
5
- * Custom hook to fetch and activate remote configuration settings.
6
- * Initializes remote configuration, fetches, activates it, and tracks the fetch status.
7
- * @returns {Object} An object containing:
8
- * - {Function} fetchAndActivate - Callback function to fetch and activate remote configuration.
9
- * - {Boolean} isFetched - Boolean representing whether the fetch-and-activate process completed.
10
- */
11
- export const useFetchAndActivate = () => {
12
- const remoteConfig = useRemoteConfig();
13
- const [isFetched, setIsFetched] = useState(false);
14
- const fetchAndActivateCallback = useCallback(async () => {
15
- try {
16
- if (remoteConfig) {
17
- await ensureInitialized(remoteConfig);
18
- await fetchAndActivate(remoteConfig);
19
- setIsFetched(true);
20
- }
21
- }
22
- catch (e) {
23
- setIsFetched(true);
24
- console.log(`Cannot read remote config: ${e?.message}`);
25
- }
26
- }, [remoteConfig]);
27
- return useMemo(() => ({
28
- fetchAndActivate: fetchAndActivateCallback,
29
- isFetched
30
- }), [isFetched, fetchAndActivateCallback]);
31
- };
@@ -1,7 +0,0 @@
1
- /**
2
- * Custom hook to retrieve a value associated with a specified key from remote configuration.
3
- * Utilizes memoization to optimize performance by recalculating the result only if dependencies change.
4
- * @param {string} key - The key for which the corresponding value is to be fetched from the remote configuration.
5
- * @returns {any | null} The value associated with the specified key if available, otherwise null.
6
- */
7
- export declare const useGetValue: (key: string) => import("@firebase/remote-config").Value | null;
@@ -1,15 +0,0 @@
1
- import { getValue } from "firebase/remote-config";
2
- import { useRemoteConfig } from "./useRemoteConfig";
3
- import { useMemo } from "react";
4
- /**
5
- * Custom hook to retrieve a value associated with a specified key from remote configuration.
6
- * Utilizes memoization to optimize performance by recalculating the result only if dependencies change.
7
- * @param {string} key - The key for which the corresponding value is to be fetched from the remote configuration.
8
- * @returns {any | null} The value associated with the specified key if available, otherwise null.
9
- */
10
- export const useGetValue = (key) => {
11
- const remoteConfig = useRemoteConfig();
12
- return useMemo(() => {
13
- return remoteConfig ? getValue(remoteConfig, key) : null;
14
- }, [key, remoteConfig]);
15
- };
@@ -1,5 +0,0 @@
1
- /**
2
- * Hook to access the Firebase Remote Config instance from the context.
3
- * @returns {RemoteConfig} The remoteConfig object from the Firebase context.
4
- */
5
- export declare const useRemoteConfig: () => import("@firebase/remote-config").RemoteConfig;
@@ -1,10 +0,0 @@
1
- import { useContext } from "react";
2
- import { FirebaseContext } from "../context/FirebaseContext";
3
- /**
4
- * Hook to access the Firebase Remote Config instance from the context.
5
- * @returns {RemoteConfig} The remoteConfig object from the Firebase context.
6
- */
7
- export const useRemoteConfig = () => {
8
- const { remoteConfig } = useContext(FirebaseContext);
9
- return remoteConfig;
10
- };