TinyBase

getTableIds

The getTableIds method returns the Ids of every Table in the Store.

getTableIds(): Ids
returnsIds

An array of the Ids of every Table 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. Although the order of Ids have no meaning, this method is expected to return them in the order in which each Table was added.

Examples

This example retrieves the Table Ids in a Store.

const store = createStore().setTables({
  pets: {fido: {species: 'dog'}},
  species: {dog: {price: 5}},
});
console.log(store.getTableIds());
// -> ['pets', 'species']

This example retrieves the Table Ids of an empty Store, returning an empty array.

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