Function: useLockState()
@roomful/react / useLockState
Function: useLockState()
Section titled “Function: useLockState()”useLockState<
TPresence>(key):LockState|null
Defined in: react/src/index.ts:1165
Subscribes to the resolved state of a single lock key (the lock-on-focus
pattern: read holder to decide whether the local peer owns the key).
Type Parameters
Section titled “Type Parameters”TPresence
Section titled “TPresence”TPresence extends PresenceData = PresenceData
The room presence shape.
Parameters
Section titled “Parameters”string
The lock key to observe.
Returns
Section titled “Returns”LockState | null
The current lock state for the key, or null when it is free.