Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
does using async before created method breaks the life cycle of vue

I've read that I can add async before created method in Vue js but doesn't that break the vue life cycle because by using async it's converted into asynchronous action and being send to the queue in the background and by that it can execute the later method like mounted before created method finishes it's job

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

By using async it's converted into asynchronous action and being send to the queue in the background

Nope. It does not run in the background. It's not even deferred to "later", the function body starts executing immediately. The only difference that it can await something, at which point the async function returns a promise for its eventual result, after the "something" has finished. But Vue ignores that returned promise (like any return value).

So yes, code after the await might run "out of order", after another hook like mounted was called, but it'll still run in the foreground at that point. In other words, if mounted relies on some stuff from created, that will need to be done synchronously. You can still do that in the first part of an async function though.

This is not any different from creating a promise chain in a created method that is defined without async.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!