@fakes/media-devices
Version:
A interactive fake implementation of MediaDevices interface in the browser for testing
20 lines (19 loc) • 432 B
JavaScript
export class Deferred {
constructor() {
this._resolve = () => { };
this._reject = () => { };
this._promise = new Promise((resolve, reject) => {
this._reject = reject;
this._resolve = resolve;
});
}
get promise() {
return this._promise;
}
resolve(value) {
this._resolve(value);
}
reject(value) {
this._reject(value);
}
}