lifecycle-utils
Preparing search index...
withLock
Function withLock
withLock
<
ReturnType
,
const
Scope
extends
readonly
any
[]
>
(
scope
:
ValidLockScope
<
Scope
>
,
callback
:
()
=>
ReturnType
|
Promise
<
ReturnType
>
,
)
:
Promise
<
ReturnType
>
Only allow one instance of the callback to run at a time for a given
scope
values.
Type Parameters
ReturnType
const
Scope
extends
readonly
any
[]
Parameters
scope
:
ValidLockScope
<
Scope
>
callback
:
()
=>
ReturnType
|
Promise
<
ReturnType
>
Returns
Promise
<
ReturnType
>
withLock
<
ReturnType
,
const
Scope
extends
readonly
any
[]
>
(
scope
:
ValidLockScope
<
Scope
>
,
acquireLockSignal
:
undefined
|
AbortSignal
,
callback
:
()
=>
ReturnType
|
Promise
<
ReturnType
>
,
)
:
Promise
<
ReturnType
>
Only allow one instance of the callback to run at a time for a given
scope
values.
Type Parameters
ReturnType
const
Scope
extends
readonly
any
[]
Parameters
scope
:
ValidLockScope
<
Scope
>
acquireLockSignal
:
undefined
|
AbortSignal
callback
:
()
=>
ReturnType
|
Promise
<
ReturnType
>
Returns
Promise
<
ReturnType
>
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
lifecycle-utils
Loading...
Only allow one instance of the callback to run at a time for a given
scope
values.