Created
February 15, 2026 13:26
-
-
Save ranajahanzaib/60ba46a656ddb9771a63611d76e36b58 to your computer and use it in GitHub Desktop.
Firestore with local cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| initializeFirestore, | |
| persistentLocalCache, | |
| persistentMultipleTabManager, | |
| } from 'firebase/firestore' | |
| const app = initializeApp(firebaseConfig) | |
| const auth = getAuth(app) | |
| // Enable firestore local cache | |
| const db = initializeFirestore(app, { | |
| localCache: persistentLocalCache({ | |
| tabManager: persistentMultipleTabManager(), | |
| }), | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment