-
Notifications
You must be signed in to change notification settings - Fork 407
Closed
Labels
Description
Since bindAsArray() uses the value callback and then we loop through the keys of the object to add them to the array, there is no guarantee of the order of the elements in the array? This is not correct. We should either (1) make use of the DataSnapshot.forEach() method to properly iterate over the snapshot in order or (2) make use of the child_added, child_removed, and child_changed events instead of the value event. I think (1) makes sense in the short term and (2) makes the most sense in the long term. We should be able to get some performance benefits by doing (2) since then we won't be recreating so many records over and over every time an item is added to the array.