enableIndexedDbPersistence
deprecatedAttempts to enable persistent storage, if possible.
On failure, enableIndexedDbPersistence()
will reject the promise or
throw an exception. There are several reasons why this can fail, which can be
identified by the code
on the error.
- failed-precondition: The app is already open in another browser tab.
- unimplemented: The browser is incompatible with the offline persistence implementation.
Note that even after a failure, the Firestore instance will remain usable, however offline persistence will be disabled.
Note: enableIndexedDbPersistence()
must be called before any other functions
(other than initializeFirestore, {@link (getFirestore:1)} or
clearIndexedDbPersistence.
Persistence cannot be used in a Node.js environment.
This function will be removed in a future major release. Instead, set
FirestoreSettings.localCache
to an instance of PersistentLocalCache
to
turn on IndexedDb cache. Calling this function when FirestoreSettings.localCache
is already specified will throw an exception.
§Parameters
- Optional settings object to configure persistence.