getDbName
The getDbName method returns the unique key of the IndexedDB the Store is being persisted to.
getDbName(): string| returns | string | The unique key of the IndexedDB. |
|---|
Example
This example creates a Persister object against a newly-created Store and then gets the unique key of the IndexedDB back out again.
import {createStore} from 'tinybase';
import {createIndexedDbPersister} from 'tinybase/persisters/persister-indexed-db';
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createIndexedDbPersister(store, 'petStore');
console.log(persister.getDbName());
// -> 'petStore'
await persister.destroy();
Since
v4.3.14