Comment

Comment by philip_roberts

Great question, and one i am not totally sure of myself. I guess the question is: if an event doesn't have any handlers listening for it, does it get queued and processed regardless? This is something I've often wondered about myself but never properly tested/been sure about.

My _guess_ would be yes, this would work. Regardless of how fast the file loaded. One way to test it would be to stick a large while loop between readastext and addeventlistener to block the stack for a few seconds and guarantee that the file is read before the handler is bound.

I'll try and take a look when I am back at a computer if nobody else responds either way :)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton