TinyBase logoTinyBase

getValueIds

The getValueIds method returns the Ids of every Value in a Store.

getValueIds(): Ids
returnsIds

An array of the Ids of every Value in the Store.

Note that this returns a copy of, rather than a reference, to the list of Ids, so changes made to the list are not made to the Store itself.

Examples

This example retrieves the Value Ids in a Store.

import {createStore} from 'tinybase';

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

This example retrieves the Value Ids of a Store that has had none set, returning an empty array.

import {createStore} from 'tinybase';

const store = createStore();
console.log(store.getValueIds());
// -> []

Since

v3.0.0