TinyBase logoTinyBase β

useHasTable

The useHasTable hook returns a reactive object indicating whether a Table exists in the Store, and registers a listener so that any changes to that result will update .current.

useHasTable(
  tableId: MaybeGetter<string>,
  storeOrStoreId?: MaybeGetter<undefined | StoreOrStoreId>,
): {current: boolean}
TypeDescription
tableIdMaybeGetter<string>

The Id of the Table (or a getter returning it).

storeOrStoreId?MaybeGetter<undefined | StoreOrStoreId>

The Store to use (plain value or getter), or its Id.

returns{current: boolean}

A reactive object with a current boolean property.

Since

v8.1.0