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

311
Vistas
Synchronizing a countdown timer through Firestore

Creating an app in Javascript in which I'm creating a timer that updates at every second and so, I want to store that timers time in firebase firestore at every update in timer so I could retrieve it with Onsnapshot on another page for displaying what would be an efficient way to do this because I don't think updating DOC every second will be a good approach

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Synchronizing each tick across the database is indeed not very efficient. But time has the nice trait that it passes (for the purpose of a use-case such as this) at the same rate on all clients. So what you'll want to do instead is store the start time and the interval of the timer in the database, and then have each client run its own local countdown based on that.

I wrote an example of this using the Firebase Realtime Database, so I recommend checking that out as a starting point: How to implement a distributed countdown timer in Firebase

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