Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do you mean setTimeout task type has lower priority than browser-rendering/user-input? if yes, could you give me official docs link or any code example to prove it. #18

Open
rjwaltz opened this issue Jan 30, 2025 · 0 comments

Comments

@rjwaltz
Copy link

rjwaltz commented Jan 30, 2025

source file link

function microtask() {
  console.log("microtask");
}

function task() {
  console.log("task");
}

setTimeout(task, 0);
queueMicrotask(microtask);
  1. Log "microtask"
  2. Return to the event loop and allow rendering/input callbacks to occur if appropriate
  3. Log "task"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant