Skip to content

Instantly share code, notes, and snippets.

@webpapaya
Created October 25, 2016 18:36
Show Gist options
  • Save webpapaya/2a891233e711dbb7e4e8412b99d105ce to your computer and use it in GitHub Desktop.
Save webpapaya/2a891233e711dbb7e4e8412b99d105ce to your computer and use it in GitHub Desktop.
const waitAtLeast1Second = waitAtLeast(1);
const apiCall = Promise.resolve('my api data');
Promise.resolve()
.then(waitAtLeast1Second(apiCall))
.then((data) => data === 'my api data');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment