ECMAScript proposal: `Promise.withResolvers()`
Briefly

Before Promise.withResolvers, Promises were directly created using the revealing constructor pattern, exposing internals only to constructor code, ensuring security in Promise usage.
Promise.withResolvers overcomes limitations by allowing settlement functions resolve and reject to be used separate from the Promise constructor, thereby enhancing flexibility and reusability.
Read at 2ality
[
add
]
[
|
|
]