()
| 105 | }; |
| 106 | |
| 107 | export const Firestore = () => { |
| 108 | const {status, data: firestoreInstance} = useInitFirestore(async (firebaseApp) => { |
| 109 | const db = initializeFirestore(firebaseApp, {}); |
| 110 | await enableIndexedDbPersistence(db); |
| 111 | return db; |
| 112 | }); |
| 113 | |
| 114 | if (status === 'loading') { |
| 115 | return <LoadingSpinner />; |
| 116 | } |
| 117 | |
| 118 | return ( |
| 119 | <> |
| 120 | <AuthWrapper fallback={<span>Sign in to use this component</span>}> |
| 121 | <FirestoreProvider sdk={firestoreInstance}> |
| 122 | <CardSection title="Get/Set document value"> |
| 123 | <Counter /> |
| 124 | </CardSection> |
| 125 | <CardSection title="Fetch data once"> |
| 126 | <StaticValue /> |
| 127 | </CardSection> |
| 128 | <CardSection title="Work with lists of data"> |
| 129 | <AnimalsList /> |
| 130 | </CardSection> |
| 131 | </FirestoreProvider> |
| 132 | </AuthWrapper> |
| 133 | </> |
| 134 | ); |
| 135 | }; |
nothing calls this directly
no test coverage detected