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:
@@ -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()
|
||||
})
|
||||
});
|
||||
|
Reference in New Issue
Block a user