Skip to content

Instantly share code, notes, and snippets.

@misaka42
Last active March 31, 2017 08:58
Show Gist options
  • Save misaka42/df81af69eafa42eb11816d8e72afc8b0 to your computer and use it in GitHub Desktop.
Save misaka42/df81af69eafa42eb11816d8e72afc8b0 to your computer and use it in GitHub Desktop.
browser nextTick
// try it in your browser
(function() {
requestAnimationFrame(() => console.log('requestAnimationFrame'))
setTimeout(() => console.log('setTimeout 10'), 10);
setTimeout(() => console.log('setTimeout 1'), 1);
setTimeout(() => console.log('setTimeout 0'), 0);
Promise.resolve().then(() => console.log('then'));
console.log('content end');
return 'fn end';
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment