TinyBase logoTinyBase

hasTable

The hasTable method returns a boolean indicating whether a given Table exists in the Store.

hasTable(tableId: string): boolean
TypeDescription
tableIdstring

The Id of a possible Table in the Store.

returnsboolean

Whether a Table with that Id exists.

Example

This example shows two simple Table existence checks.

import {createStore} from 'tinybase';

const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
console.log(store.hasTable('pets'));
// -> true
console.log(store.hasTable('employees'));
// -> false

Since

v1.0.0