Promise.withResolvers()
Newly Available (since 2024-03-05)
Expected to be Widely Available on 2026-09-05
The Promise.withResolvers() static method is an alternative to the Promise() constructor that returns both the promise and resolution functions. You can use this to access resolve and reject outside the scope of the executor function.
Browser support
- Chrome 119 Released on 2023-10-31
- Chrome Android 119 Released on 2023-10-31
- Edge 119 Released on 2023-11-02
- Firefox 121 Released on 2023-12-19
- Firefox for Android 121 Released on 2023-12-19
- Safari 17.4 Released on 2024-03-05
- Safari on iOS 17.4 Released on 2024-03-05
MDN documentation
Specifications
- ECMAScript® 2027 Language Specification (#sec-promise.withResolvers), from TC39 (Ecma International).
Usage (according to Chrome Platform Status)
~3.605% of page loads. More data at chromestatus.com.View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist