Skip to content

Instantly share code, notes, and snippets.

@jhunterkohler
Created July 30, 2021 10:16
Show Gist options
  • Save jhunterkohler/3a6f063d7cc73dc43ed34d09917ef465 to your computer and use it in GitHub Desktop.
Save jhunterkohler/3a6f063d7cc73dc43ed34d09917ef465 to your computer and use it in GitHub Desktop.
control your promises
export class Resolvable extends Promise {
constructor() {
let _resolve;
let _reject;
super((resolve, reject) => {
_resolve = resolve;
_reject = reject;
});
this.resolve = _resolve;
this.reject = _reject;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment