MutationsDataSnapshot forEach method runs its callback on mutations Array through Array.prototype.every function. Thus, if the callback does not return true it will only be run once on first mutation.
Docs should be updated to reflect this behavior.
Current example :
chatRef.on('mutations', snap => {
snap.forEach(mutationSnap => {
handleMutation(mutationSnap);
});
})
Should at least include :
chatRef.on('mutations', snap => {
snap.forEach(mutationSnap => {
handleMutation(mutationSnap);
return true; // Return true to continue iterating mutations
});
})
MutationsDataSnapshot forEach method runs its callback on mutations Array through Array.prototype.every function. Thus, if the callback does not return true it will only be run once on first mutation.
Docs should be updated to reflect this behavior.
Current example :
Should at least include :