TinyBase logoTinyBase β

getUrls

The getUrls method returns the URLs the Store is being persisted to.

getUrls(): [string, string]
returns[string, string]

The load and save URLs as a two-item array.

Example

This example creates a RemotePersister object against a newly-created Store and then gets the URLs back out again.

import {createRemotePersister} from 'tinybase/persisters/persister-remote';
import {createStore} from 'tinybase';

const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createRemotePersister(
  store,
  'https://example.com/load',
  'https://example.com/save',
  5,
);

console.log(persister.getUrls());
// -> ['https://example.com/load', 'https://example.com/save']

persister.destroy();

Since

v4.3.14