proposal-promise-with-resolvers
ECMAScript Proposals
tc39/proposal-promise-with-resolvers
promiseのresolve,rejectを外に出すやつ
以前はこういうふうに
code:ts
function withResolvers() {
let resolve
const promise = new Promise( res => {resolve = res})
return {promise, resolve}
}
Promiseを外側からresolveする