Interface: InjectLocksResult
@roomful/angular / InjectLocksResult
Interface: InjectLocksResult
Section titled “Interface: InjectLocksResult”Defined in: angular/src/index.ts:297
Describes the return value of injectLocks.
Properties
Section titled “Properties”getHolder()
Section titled “getHolder()”getHolder: (
key) =>Peer<PresenceData> |null
Defined in: angular/src/index.ts:331
Returns the peer currently holding a key, or null.
Returns the peer currently holding key, or null when the lock is free.
Parameters
Section titled “Parameters”string
The lock key to resolve.
Returns
Section titled “Returns”Peer<PresenceData> | null
The holding peer, or null.
isLocked()
Section titled “isLocked()”isLocked: (
key) =>boolean
Defined in: angular/src/index.ts:326
Reports whether a key is currently held by any peer.
Reports whether key is currently held by any peer (including the local
peer).
Parameters
Section titled “Parameters”string
The lock key to test.
Returns
Section titled “Returns”boolean
true when the key has a non-expired holder.
locks:
Signal<LockState[]>
Defined in: angular/src/index.ts:301
Exposes the resolved state of every currently-held lock.
release()
Section titled “release()”release: (
key) =>void
Defined in: angular/src/index.ts:316
Releases a lock held by the local peer.
Releases a lock held by the local peer. No-op when the local peer does not
hold key.
Parameters
Section titled “Parameters”string
The lock key to release.
Returns
Section titled “Returns”void
Nothing.
releaseAll()
Section titled “releaseAll()”releaseAll: () =>
void
Defined in: angular/src/index.ts:321
Releases every lock held by the local peer.
Releases every lock currently held by the local peer.
Returns
Section titled “Returns”void
Nothing.
Methods
Section titled “Methods”acquire()
Section titled “acquire()”acquire(
key,options?):Promise<boolean>
Defined in: angular/src/index.ts:311
Claims exclusive ownership of a key, resolving whether the local peer holds it.
Parameters
Section titled “Parameters”string
The lock key to claim.
options?
Section titled “options?”LockAcquireOptions
Optional TTL and acquire-timeout configuration.
Returns
Section titled “Returns”Promise<boolean>
A promise resolving to whether the local peer holds the key.