TinyBase

getJson

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

getJson(): string
returnsstring

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.getJson());
// -> '{"pets":{"fido":{"species":"dog"}}}'

This example serializes the contents of an empty Store.

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