TinyBase logoTinyBase β

useBindableValue

The useBindableValue hook returns a reactive object reflecting the value of a Value, with a settable current property that writes back to the Store.

useBindableValue(
  valueId: MaybeGetter<string>,
  storeOrStoreId?: MaybeGetter<undefined | StoreOrStoreId>,
): {current: ValueOrUndefined}
TypeDescription
valueIdMaybeGetter<string>

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

storeOrStoreId?MaybeGetter<undefined | StoreOrStoreId>

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

returns{current: ValueOrUndefined}

A reactive object with gettable and settable current.

Since

v8.1.0