Files
evento/node_modules/kysely/dist/cjs/util/deferred.js
2026-03-18 14:55:56 -03:00

29 lines
631 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Deferred = void 0;
class Deferred {
#promise;
#resolve;
#reject;
constructor() {
this.#promise = new Promise((resolve, reject) => {
this.#reject = reject;
this.#resolve = resolve;
});
}
get promise() {
return this.#promise;
}
resolve = (value) => {
if (this.#resolve) {
this.#resolve(value);
}
};
reject = (reason) => {
if (this.#reject) {
this.#reject(reason);
}
};
}
exports.Deferred = Deferred;