lifecycle-utils
Preparing search index...
withLock
Function withLock
withLock
<
ReturnType
,
const
ScopeType
=
any
>
(
scope
:
ScopeType
,
key
:
string
,
callback
:
(
this
:
ScopeType
)
=>
Promise
<
ReturnType
>
,
)
:
Promise
<
ReturnType
>
Only allow one instance of the callback to run at a time for a given
scope
and
key
.
Type Parameters
ReturnType
const
ScopeType
=
any
Parameters
scope
:
ScopeType
key
:
string
callback
:
(
this
:
ScopeType
)
=>
Promise
<
ReturnType
>
Returns
Promise
<
ReturnType
>
withLock
<
ReturnType
,
const
ScopeType
=
any
>
(
scope
:
ScopeType
,
key
:
string
,
acquireLockSignal
:
undefined
|
AbortSignal
,
callback
:
(
this
:
ScopeType
)
=>
Promise
<
ReturnType
>
,
)
:
Promise
<
ReturnType
>
Only allow one instance of the callback to run at a time for a given
scope
and
key
.
Type Parameters
ReturnType
const
ScopeType
=
any
Parameters
scope
:
ScopeType
key
:
string
acquireLockSignal
:
undefined
|
AbortSignal
callback
:
(
this
:
ScopeType
)
=>
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
andkey
.