Re:What Kind of Asynchronous Is Right for You?
by erhaetherth on Saturday June 17, 2023 @04:43AM
(#36368439)
We have this problem at my work. Some components listen for events, but where did they come from? I have no idea, I didn't write the entire stack, and there isn't an easy way to trace it. Similarly, if I send an event (and this may be JS/DOM specific), who is going to catch it, and are they going to prevent it from bubbling up to other listeners (potentially breaking them)?
[ Parent
| on HN ]
Re:What Kind of Asynchronous Is Right for You?
by hinkley on Sunday June 18, 2023 @08:09AM
(#36379479)
I had a logic bug in some new code this week and was reminded that in JavaScript, if you emit an Error and there are no handlers, it bubbles back up to the emitter as an exception.
Someone’s notion that they didn’t want errors to go unhandled. So I had to rewrite the logic so the conditional for reporting the error was inside the listener instead of around it.