TinyBase logoTinyBase

getTablesJson

The getTablesJson method returns a string serialization of all of the Tables in the Store.

getTablesJson(): Json
returnsJson

A string serialization of all of the Tables in the Store.

Examples

This example serializes the contents of a Store.

const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
console.log(store.getTablesJson());
// -> '{"pets":{"fido":{"species":"dog"}}}'

This example serializes the contents of an empty Store.

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

Since

v3.0.0