-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.js
21 lines (20 loc) · 1015 Bytes
/
node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**@module ForkedOutPromise:nodeModuleDoc
* @author fbarda [email protected]
*/
/**@typedef {Object} ForkedOutPromiseInstance - An object containing a promise and the promise's resolve and reject functions.
* @prop {Promise<*>} promise - Designed to return via a callback-style async function. Use `this.resolve` and `this.reject` to control the promise via a callback.
* @prop {(value:*=)=>void} resolve Makes the [promise]{@link ForkedOutPromiseInstance#promise} resolve with the given argument.
* @prop {(reason:*=)=>void} reject Makes the [promise]{@link ForkedOutPromiseInstance#promise} reject with the given error argument.
*/
/** @class */
module.exports = exports = class ForkedOutPromise {
/** @returns {ForkedOutPromiseInstance} A new {@linkplain ForkedOutPromise} object. */
constructor() {
this.promise = new Promise(
(resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
}
);
}
};