TinyBase logoTinyBase β

useStoreOrStoreById

The useStoreOrStoreById hook is used to get a reference to a Store object from a Provider context, or have it passed directly.

useStoreOrStoreById(storeOrStoreId?: MaybeGetter<undefined | StoreOrStoreId>): () => Store | undefined
TypeDescription
storeOrStoreId?MaybeGetter<undefined | StoreOrStoreId>

The Store, its Id, or a getter returning either.

returns() => Store | undefined

A getter function returning the Store, or undefined.

Since

v8.1.0