Right now I've got a little bit confused with browser events. I'm still not sure how event loop starts working. For example, when I dispatch custom event in the mid of some function, does event handling start right away or is it moved to the event queue?
And what about other events? If I click or the page is loaded, what happens? When does the event handling process begin?