UNPKG

@jellyfish-dev/ts-client-sdk

Version:
18 lines (17 loc) 380 B
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); } }