This repository has been archived on 2025-07-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
eternos/frontend/style/node_modules/next/dist/esm/lib/detached-promise.js
2025-01-11 09:54:09 +03:00

22 lines
679 B
JavaScript

/**
* A `Promise.withResolvers` implementation that exposes the `resolve` and
* `reject` functions on a `Promise`.
*
* @see https://tc39.es/proposal-promise-with-resolvers/
*/ export class DetachedPromise {
constructor(){
let resolve;
let reject;
// Create the promise and assign the resolvers to the object.
this.promise = new Promise((res, rej)=>{
resolve = res;
reject = rej;
});
// We know that resolvers is defined because the Promise constructor runs
// synchronously.
this.resolve = resolve;
this.reject = reject;
}
}
//# sourceMappingURL=detached-promise.js.map