Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

105
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda