TinyBase logoTinyBase

getValues

The getValues method returns an object containing the entire set of keyed Values in the Store.

getValues(): Values
returnsValues

An object containing the entire data of the Values.

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 keyed Values data in a Store.

const store = createStore().setValues({open: true, employees: 3});
console.log(store.getValues());
// -> {open: true, employees: 3}

This example retrieves a Values from a Store that has none, returning an empty object.

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

Since

v3.0.0