Closed jacobg closed 4 years ago
Thank you for your feedback. Although the package can reduce boilerplate code, that's not its main purpose, so I would avoid adding features that don't serve the main goal - having a "flatter" (indentation-wise) code.
If there will be more suggestions like your, I would consider adding an extendable result to support plugins, like:
// done once:
flatPromise.extend(querablePromise);
// usage:
const promise = flatPromise();
console.log( promise.isResolved() );
where querablePromise will be something like described here and will extend the resulted promise
This is a very useful project to get rid of boilerplate!
In the theme of adding method and properties to Promise to strip out this boilerplate, it would be very useful to have properties or methods that indicate whether the Promise has been resolved or rejected, and even the resolve/reject value.