TinyBase logoTinyBase β

useRowCount

The useRowCount hook returns a reactive object reflecting the number of Rows in a Table, and registers a listener so that any changes will update .current.

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

A reactive object with a current number property.

Since

v8.1.0