@jellyfish-dev/ts-client-sdk
Version:
Typescript client library for Jellyfish.
18 lines (17 loc) • 380 B
JavaScript
export class Deferred {
promise;
resolveFn = () => null;
rejectFn = () => null;
constructor() {
this.promise = new Promise((resolve, reject) => {
this.resolveFn = resolve;
this.rejectFn = reject;
});
}
resolve(value) {
this.resolveFn(value);
}
reject(reason) {
this.rejectFn(reason);
}
}