5

Ajax calls are they scheduled as microtasks or macrotasks ?

And is there any difference between browsers.

Mohamed Gara
  • 2,665
  • 3
  • 13
  • 19
  • Where did you learn about micro- vs macrotasks that didn't explain this? – Bergi Oct 31 '17 at 17:00
  • I looked quickly here https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/ but I didn't found the response. And when I revised this book https://www.manning.com/books/secrets-of-the-javascript-ninja-second-edition, I found the respone. – Mohamed Gara Oct 31 '17 at 17:26

1 Answers1

2

In the book Secrets of the JavaScript Ninja, 2nd Edition, the author state that the Network events are scheduled as Macrotasks.

So, an XHR callback is queued with Macrotasks.

Mohamed Gara
  • 2,665
  • 3
  • 13
  • 19