promiseCleanupUtil
An utility module for working with Promise cleanups.
Functions
addPromiseAndCleanupOnFinishedRunning
promiseCleanupUtil.
addPromiseAndCleanupOnFinishedRunning
(
promise:
Promise
,
key:
string
,
cleanupTable:
{
[
string
]
:
Promise
}
) →
(
)
Adds the given promise
to cleanupTable
, indexed by key
. Once the promise has finished running, it'll be safely
removed from cleanupTable
.
findAndCancelPromise
promiseCleanupUtil.
findAndCancelPromise
(
key:
string
,
cleanupTable:
{
[
string
]
:
any
}
) →
(
)
Finds the given promise keyed by key
in cleanupTable
, if found, it will be cancelled and
the promise will be removed from the cleanupTable
..