@twilio/voice-sdk
Version:
Twilio's JavaScript Voice SDK
18 lines (14 loc) • 388 B
text/typescript
// @ts-nocheck
export default class Deferred<T> {
readonly promise: Promise<T>;
private _reject: (e?: any) => void;
get reject() { return this._reject; }
private _resolve: (t?: T) => void;
get resolve() { return this._resolve; }
constructor() {
this.promise = new Promise((resolve, reject) => {
this._resolve = resolve;
this._reject = reject;
});
}
}