Skip to content

Instantly share code, notes, and snippets.

@geta6
Last active September 3, 2015 11:00
Show Gist options
  • Select an option

  • Save geta6/cbf9db54a2c96acc6d8a to your computer and use it in GitHub Desktop.

Select an option

Save geta6/cbf9db54a2c96acc6d8a to your computer and use it in GitHub Desktop.
(() => {
'use strict';
let nums = [1, 2, 3];
Promise.all(nums.map(num => new Promise(resolve => {
requestIdleCallback(() => resolve(num * num));
}))).then(processed => {
console.log('done: %o', processed);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment