TinyBase logoTinyBase

hasTablesSchema

The hasTablesSchema method returns a boolean indicating whether the Store currently has a TablesSchema applied to it.

hasTablesSchema(): boolean
returnsboolean

Whether the Store has a TablesSchema applied to it.

Example

This example sets a TablesSchema and checks that it is present.

import {createStore} from 'tinybase';

const store = createStore().setTablesSchema({
  pets: {
    price: {type: 'number'},
  },
});
console.log(store.hasTablesSchema());
// -> true

store.delTablesSchema();
console.log(store.hasTablesSchema());
// -> false

Since

v4.1.1