Skip to content

Instantly share code, notes, and snippets.

@AhmedTarekHasan
Created October 20, 2021 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AhmedTarekHasan/e047a2e5a4c2abe4c9b3fe3e7573b565 to your computer and use it in GitHub Desktop.
Save AhmedTarekHasan/e047a2e5a4c2abe4c9b3fe3e7573b565 to your computer and use it in GitHub Desktop.
let doInterestingThings = function() {
return new PromiseWithTimeout((resolve, reject) => {
// do some interesting things
// call resolve(data) or reject() before 5 seconds have passed
// otherwise, sorry have to return!
}, 5000);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment