Constructor
new ReusablePromise(configuration)
Parameters:
Name |
Type |
Description |
configuration |
object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
save |
boolean
|
<optional>
|
false
|
if set to `true`, stores the result of the first successful promise forever. |
|
- Source:
Classes
- ReusablePromise
Methods
(async) call(createPromise) → {Promise.<T>}
Checks if a promise exists, if so, `await`s it, otherwise sets a new `Promise` produced by
calling `createPromise` function.
Parameters:
Name |
Type |
Description |
createPromise |
function
|
|
- Source:
Returns:
-
Type
-
Promise.<T>