Skip to content

Instantly share code, notes, and snippets.

@adambene
Created March 8, 2018 00:11
Show Gist options
  • Save adambene/5b8f08e2f8a84c924a250e2a0f6d6cef to your computer and use it in GitHub Desktop.
Save adambene/5b8f08e2f8a84c924a250e2a0f6d6cef to your computer and use it in GitHub Desktop.
Delay With a Value in JavaScript
const delay = (ms, result) =>
new Promise(resolve => setTimeout(() => resolve(result), ms));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment