1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-10-22 17:06:51 +02:00

make db obj sync and enable offline persistance

This commit is contained in:
Kushagra Gour
2024-05-10 15:07:39 +05:30
parent a9931ab5fb
commit c4efbf2399
4 changed files with 26 additions and 69 deletions

View File

@@ -1,6 +1,10 @@
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { getFirestore } from 'firebase/firestore';
import {
initializeFirestore,
persistentLocalCache,
persistentMultipleTabManager
} from 'firebase/firestore';
import { getStorage } from 'firebase/storage';
const config = {
@@ -16,5 +20,9 @@ const app = initializeApp(config);
export { app };
export const auth = getAuth(app);
export const db = getFirestore(app);
export const storage = getStorage(app);
export const db = initializeFirestore(app, {
localCache: persistentLocalCache({
tabManager: persistentMultipleTabManager()
})
});