I need to call below method in created()
. For this purpose, I need to make created()
as async
. Per Vue documentation, created()
is called synchronously. Will Vue Framework await
on created()
to avoid any race conditions?
this.isAuthenticated = await authService.isAuthenticated();
created
async doesn't fix race conditions when something inmounted
relies on resolution of an async call increated
, sincemounted
will begin executing beforecreated
finishes. That said, tacking onasync
tocreated()
will not throw and error, and you certainly can useawait
within.