I'm using NodeJS, and listening for updates on an object using the following code:
let ref = mainRef.child("objectKey");
ref.on("value", (snapshot) => {
console.log("update");
console.log(snapshot.val());
});
Then I notice that sometimes, a single change causes 14 or 15 triggers of this events, bringing the latest state of the object, and some previous states as well.
The code above is running only once so there are no multiple registrations to the "value" event.
What's the problem?
Thanks