Open Promise Constructor
Returns whether is the promise finished
Rejects promise
Returns whether is the promise rejected
Resolves promise
Returns whether is the promise resolved
Binds a promise to the inner promise to resolve or reject with it
A promise to bind inner promise
Attaches a callback for only the rejection of the Promise.
The callback to execute when the Promise is rejected.
A Promise for the completion of the callback.
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
The callback to execute when the Promise is settled (fulfilled or rejected).
A Promise for the completion of the callback.
Attaches callbacks for the resolution and/or rejection of the Promise.
The callback to execute when the Promise is resolved.
The callback to execute when the Promise is rejected.
A Promise for the completion of which ever callback is executed.
Generated using TypeDoc
Open Promise
A promise constructor to resolve or reject from outside
Example:
import { OpenPromise } from "@thalesrc/js-utils"; const aPromiseWillBeResolvedLater = new OpenPromise(); aPromiseWillBeResolvedLater.then(val => console.log(val)); // aPromiseWillBeResolvedLater.finished // false ... ... aPromiseWillBeResolvedLater.resolve({x: 1}); // aPromiseWillBeResolvedLater.finished // true
T typeof the value which is going to be resolved