Re:Top-level await in JavaScript is a footgun
by Touche on Wednesday September 14, 2016 @04:25PM
(#12500945)
So you're ok that your app waits on module dependencies, but data dependencies it should not?
[ Parent
| on HN ]
Re:Top-level await in JavaScript is a footgun
by untog on Wednesday September 14, 2016 @08:09PM
(#12502371)
But my app doesn't wait on module dependencies - the code is bundled. It does wait on code parsing time (which no, I don't consider ideal) but that's a far cry from waiting on an async data download operation.
As far as I'm concerned, an explicit call to `ModuleB.loadData()` is far better than having it happen as part of module loading, without me necessarily being aware of it. Right now, module loading is assured to be synchronous, and losing that certainty seems like a bad idea to me.