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