TinyBase logoTinyBase

getStorageName

The getStorageName method returns the unique key of the storage location the Store is being persisted to.

getStorageName(): string
returnsstring

The unique key of the storage location.

Example

This example creates a Persister object against a newly-created Store and then gets the unique key of the storage location back out again.

const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createLocalPersister(store, 'pets');

console.log(persister.getStorageName());
// -> 'pets'

persister.destroy();

Since

v4.3.14