I'm not sure if I understood what you said, but the (async function() { is necessary otherwise I'll get a Uncaught SyntaxError: await is only valid in async functions, async generators and modules.
And I used a then chaining just because I find it more declarative (a more functional style code).
And if I take off the async and the await, then the hideLoadingMessage function will run before the fetch finishes. But maybe I could chain it as well, or something, and then the async/await could be taken off.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm not sure if I understood what you said, but the
(async function() {
is necessary otherwise I'll get aUncaught SyntaxError: await is only valid in async functions, async generators and modules
.And I used a
then
chaining just because I find it more declarative (a more functional style code).And if I take off the
async
and theawait
, then thehideLoadingMessage
function will run before thefetch
finishes. But maybe I could chain it as well, or something, and then theasync/await
could be taken off.