3 ms·
I may sound like a dinosaur, but const id = reader.u32() ?? await A awaiting a magical A that comes from an import and that was never touched before looks
by mmarq 4y ago
I may sound like a dinosaur, but
const id = reader.u32() ?? await A
awaiting a magical A that comes from an import and that was never touched before looks very weird.
- lioeters 4y agoIt's not just you - I regularly read a fair amount of Type/JavaScript, and that is a weird library API. The A function resolves to a singleton instance of Promise, which is updated by the class QuickReader. It means multiple instances of QuickReader will overwrite each other. In other words, A only works with the last instance of QuickReader created. I'm not sure if that's the intended behavior, but I would have designed it differently.
- etherdream 4y agoThis is not a problem, `await A` is called immediately after each read, so there will be no conflict.