Interface: UseWebLockRunOptions
Defined in: use-web-lock.ts:26
Per-call options for the run function returned by useWebLock.
Extends
Properties
ifAvailable?
optionalifAvailable?:boolean
Defined in: use-web-lock.ts:16
If the lock cannot be granted immediately, skip the work: fn is not
called and run resolves undefined. Default is false.
Inherited from
mode?
optionalmode?:LockMode
Defined in: use-web-lock.ts:11
"exclusive" lets one holder at a time own the lock, "shared" lets any
number of holders own it together. Default is "exclusive".
Inherited from
signal?
optionalsignal?:AbortSignal
Defined in: use-web-lock.ts:33
Aborts the call. While the lock is still being waited for, run rejects
with the signal's reason. Once the lock is held, fn receives an
AbortSignal that follows this one. Ignored by the browser, but still
forwarded to fn, when ifAvailable or steal is set.
steal?
optionalsteal?:boolean
Defined in: use-web-lock.ts:22
Release any lock with the same name held in this origin and grant this
request right away. The previous holder's run rejects with an
AbortError. Needs "exclusive" mode. Default is false.