-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Describe your problem or use case
We are currently implementing a cache of object accessors in realm-js that we want be able to prune on modification or deletion events, keyed by the object_id. Currently when I register a listener to a collection, I get a change set containing the indexes that were changed. In the case of deletions, it is not possible to determine what objects were deleted.
Describe the solution you'd like
I have two possible solutions:
- Include {{object_id}}s in the changeSet given to the callback
- Provide a frozen collection to the callback that shows a snapshot of the collection before the changes depicted in the changeSet.
Additional context
I think variation 1 would be easier to implement, but variation 2 would offer the possibility of having more logic in the listener callbacks, such as comparing the old collections verses the new and performing some action based on that.
- is depended on by
-
RNET-624 [Bug]: NotifyCollectionChangedEventArgs OldItem is InvalidObject when updating the data
- Closed