Skip to content

Commit

Permalink
Merge pull request #3025 from gdg-x/firestore
Browse files Browse the repository at this point in the history
Remove deprecated enableMultiTabIndexedDbPersistence
  • Loading branch information
abraham authored Mar 2, 2024
2 parents 2a5cde3 + ec0372d commit d0a4ce0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/firebase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getAnalytics } from 'firebase/analytics';
import { FirebaseOptions, initializeApp } from 'firebase/app';
import { enableMultiTabIndexedDbPersistence, getFirestore } from 'firebase/firestore';
import { Firestore, initializeFirestore, persistentLocalCache } from 'firebase/firestore';
import { getPerformance, initializePerformance } from 'firebase/performance';

/**
Expand All @@ -26,9 +26,10 @@ if (!firebaseConfig) {
}

export const firebaseApp = initializeApp(firebaseConfig);
export const db = getFirestore(firebaseApp);
export const db: Firestore = initializeFirestore(firebaseApp, {
localCache: persistentLocalCache(),
});
export const performance = getPerformance(firebaseApp);
export const analytics = getAnalytics(firebaseApp);

initializePerformance(firebaseApp);
enableMultiTabIndexedDbPersistence(db);

0 comments on commit d0a4ce0

Please sign in to comment.