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

132
Vistas
When to decide between fetching data from API or use the client cache if push events don't exist?

Imagine you had a simple todo app using Vue and Vuex with a backend (external API, localstorage, ...).

Inside the store you hold all the todos and manage them. But when should you synchronize your store with the backend? Always? If yes, then Vuex is redundant and you can directly call the backend.

Many tutorials out there show examples like

function getTodos() {
  const store = getStoreInstance();
  
  if(!store.todos) {
    store.todos = fetchTodosFromBackend();
  }

  return store.todos;
}

but by doing so the store would synchronize with the backend only once. Imagine the backend provides no push events and you can only ask for data or send write requests.

What are the best practices to keep the todos (which might be manuplated by other clients) in sync with the store?

about 4 years ago · Juan Pablo Isaza
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