withResolvers
Ponyfill for Promise.withResolvers()
118 bytes
Usage
Creates a new promise and returns the resolve and reject functions along with the promise itself.
The ponyfill for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
import * as _ from 'radashi'
const { resolve, reject, promise } = _.withResolvers()
resolve(42)