Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

312
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda