Reputation: 190
I have used firebase onChildAdded and onChildChanged both seem very important since they provide information through dataSnaphot object, but incase of onChildRemoved I'm wondering what its purpose is because already that child is gone and I am curious what the dataSnapshot provides.
Upvotes: 0
Views: 468
Reputation: 600131
From the Firebase documentation the DataSnapshot
for onChildRemoved
is:
An immutable snapshot of the data at the child that was removed.
So this contains the data that was removed. Mostly you'll use the key DataSnapshot.getKey()
to remove the UI elements corresponding to the data.
Upvotes: 1