TinyBase logoTinyBase

getTables

The getTables method returns a Tables object containing the entire tabular data of the Store.

getTables(): Tables
returnsTables

A Tables object containing the tabular data of the Store.

Note that this returns a copy of, rather than a reference to the underlying data, so changes made to the returned object are not made to the Store itself.

Examples

This example retrieves the tabular data in a Store.

const store = createStore().setTables({
  pets: {fido: {species: 'dog'}},
  species: {dog: {price: 5}},
});
console.log(store.getTables());
// -> {pets: {fido: {species: 'dog'}}, species: {dog: {price: 5}}}

This example retrieves the Tables of an empty Store, returning an empty object.

const store = createStore();
console.log(store.getTables());
// -> {}