Re:<dialog>: The Dialog Element
by simonw on Saturday December 07, 2024 @05:18AM
(#42348712)
I found that non-obvious too: in both Python and JavaScript I've always seen "await ..." as effectively a hack to enable concurrent execution via an event loop, where the hope is that you won't be waiting very long at all for a response.
Realizing that you could use it for user input - where your promise might not resolve for minutes or even hours - was a bit of a light bulb moment for me.
Realizing that you could use it for user input - where your promise might not resolve for minutes or even hours - was a bit of a light bulb moment for me.