Skip to content

Instantly share code, notes, and snippets.

@acacha
Forked from ericelliott/wait.js
Created November 15, 2017 17:57
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 acacha/f10db679bb05254a99a79f1f7ba36203 to your computer and use it in GitHub Desktop.
Save acacha/f10db679bb05254a99a79f1f7ba36203 to your computer and use it in GitHub Desktop.
Wait -- an ES6 promise example
const wait = time => new Promise((resolve) => setTimeout(resolve, time));
wait(3000).then(() => console.log('Hello!')); // 'Hello!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment