Skip to content

Instantly share code, notes, and snippets.

@ranajahanzaib
Created February 15, 2026 13:26
Show Gist options
  • Select an option

  • Save ranajahanzaib/60ba46a656ddb9771a63611d76e36b58 to your computer and use it in GitHub Desktop.

Select an option

Save ranajahanzaib/60ba46a656ddb9771a63611d76e36b58 to your computer and use it in GitHub Desktop.
Firestore with local cache
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