3 ms·
The setTimeout(..., 0) is important to be able to force things to be at the end of the queue after the current task completes. So if you are going to batch requ
by madhadron 6y ago
The setTimeout(..., 0) is important to be able to force things to be at the end of the queue after the current task completes. So if you are going to batch requests, your current task can create a bunch that all queue somewhere, and then setTimeout(..., 0) can be used to dispatch them all at once.