'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



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source