getTables
The getTables
method returns a Tables
object containing the entire tabular data of the Store
.
getTables(): Tables
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
.
import {createStore} from 'tinybase';
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.
import {createStore} from 'tinybase';
const store = createStore();
console.log(store.getTables());
// -> {}
Since
v1.0.0