Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

enableIndexedDbPersistence

deprecated

Attempts 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.

@deprecated

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.

function enableIndexedDbPersistence(firestore: Firestore, persistenceSettings?: PersistenceSettings): Promise<void>;
§
enableIndexedDbPersistence(firestore: Firestore, persistenceSettings?: PersistenceSettings): Promise<void>
[src]

§Parameters

§
firestore: Firestore
[src]
  • The Firestore instance to enable persistence for.
§
persistenceSettings?: PersistenceSettings optional
[src]
  • Optional settings object to configure persistence.

§Return Type

§
Promise<void>
[src]

A Promise that represents successfully enabling persistent storage.