TinyBase logoTinyBase β

getValuesJson

The getValuesJson method returns a string serialization of all of the keyed Values in the Store.

getValuesJson(): string
returnsstring

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

Examples

This example serializes the keyed value contents of a Store.

import {createStore} from 'tinybase';

const store = createStore().setValues({open: true});
console.log(store.getValuesJson());
// -> '{"open":true}'

This example serializes the contents of an empty Store.

import {createStore} from 'tinybase';

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

Since

v3.0.0