TinyBase logoTinyBase β

useTable

The useTable hook returns a reactive object reflecting a Table in a Store, and registers a listener so that any changes to that Table will update .current.

useTable(
  tableId: MaybeGetter<string>,
  storeOrStoreId?: MaybeGetter<undefined | StoreOrStoreId>,
): {current: Table}
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: Table}

A reactive object with a current Table property.

Since

v8.1.0