Class: PersistenceStoreManager

PersistenceStoreManager

PersistenceStoreManager used for offline support

Constructor

new PersistenceStoreManager()

Source:

Methods

(static) .registerDefaultStoreFactory(factory)

Register the default PersistenceStoreFactory to create PersistenceStore for stores that don't have any factory registered under. family.
Parameters:
Name Type Description
factory Object The factory instance used to create PersistenceStore
Source:

##deleteStore(name, options) → {Promise}

Delete the specific store, including all the content stored in the store.
Parameters:
Name Type Description
name string The name of the store to delete
options Object | null Optional options when perform the delete.
  • options.version The version of this store to delete. If not specified, all versions of the store will be deleted.
Source:
Returns:
Returns a Promise which resolves to true if the store is actually deleted, and false otherwise.
Type
Promise

##hasStore(name, options) → {boolean}

Check whether a specific version of a specific store exists or not.
Parameters:
Name Type Description
name string The name of the store to check for existence
options Object | null Optional options when perform the check.
  • options.version The version of this store to check. If not specified, any version of the store counts.
Source:
Returns:
Returns true if the store with the name exists of the specific version, false otherwise.
Type
boolean

##openStore(name, options) → {Promise}

Get hold of a store for a collection of records of the same type. Returns a promise that resolves to an instance of PersistenceStore that's ready to be used.
Parameters:
Name Type Description
name string Name of the store.
options Object | null Optional options to tune the store
  • options.index array of fields to create index for
  • options.version The version of this store to open, default to be '0'.
Source:
Returns:
Returns an instance of a concrete PersistenceStore.
Type
Promise