I'm trying to figure out the best way to enable Firestore persistence and adjust the cache size using AngularFire.
Firebase documentation suggest we do it like this:
firebase.firestore().settings({
cacheSizeBytes: firebase.firestore.CACHE_SIZE_UNLIMITED
});
AngularFire does not mention adjusting such settings, but digging into the code it looks like you can pass an object of type "firebase.firestore.PersistanceSettings" in as such:
AngularFirestoreModule.enablePersistence({
experimentalForceOwningTab: true,
synchronizeTabs: true,
}),
However, those are the only two properties allowed in the PersistanceSettings type.
I tried creating a constructor in app.module.ts and doing things according to the Firebase documentation but I'm not even sure if it is working.
export class AppModule {
constructor() {
firebase.firestore().settings({
cacheSizeBytes: firebase.firestore.CACHE_SIZE_UNLIMITED,
});
}
}
How do I check what the cache size settings are at run time? Am I doing it right?