hasTable
The hasTable method returns a boolean indicating whether a given Table exists in the Store.
hasTable(tableId: string): boolean| Type | Description | |
|---|---|---|
tableId | string | |
| returns | boolean |
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