-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for keypath filtering for notifications #1398
Comments
Related question from realm-cocoa |
That cocoa issue highlights the issue a lot better than I did. Ignoring certain properties is the key. My issue is that I would like it if you call also ignore properties on Linked objects. |
The idiosyncratic .NET approach would be to use While there's value in extending the I'll leave this issue open as a way to measure community interest and if we get enough requests/upvotes, we'll prioritize it. |
Hi thanks for the reply. Yes being able to bind to changing properties within a cell using INotifyPropertyChanged is very useful. However a full cell update is more frequently the desired visual effect, both iOS and Android allow you to notify specific cells to be refreshed resulting in a short fade out and then fade back in with the new data. Just updating view properties via normal data binding generally occurs with no animation and doesn't really look right for cells in most cases. SubscribeForNotifications and ChangeSet seem to be better suited to dispatching cell updates in iOS and Android than INotifyCollectionChanged if you're not using Xamarin Forms. |
I like this idea. |
+1 |
1 similar comment
+1 |
+11111111111111 |
+1 |
@nirinchev The Key Path Filtering for Change Notifications PR in Core could probably offer an alternative for this as soon as it is accepted and merged. |
+1 !! I have found that changes to child (RealmObject) collections within a parent (RealmObject) cause our query subscription delegate to be invoked with ChangeSet.ModifiedIndices. This was unexpected by us, and it causes our layouts to re-initialize needlessly. We'd like to be able to selectively filter out these change notifications on a per-property basis, and it was confirmed to us that this feature would allow us to do that. |
Goals
To be able to subscribe to a RealmCollection for updates but not trigger a notification if only some linked object is changed.
Say I have a RealmCollection of
Things
. I don't always want a notification if only one of theSubThings
properties gets updated.Expected Results
The reason is that I might have recyclerview of
Things
. If aSubThing
changes then a partial cell update should happen using normal data binding within the cell to theSubThing
. If aThing
actually changes then I want to calladapter.NotifyDataSetChanged()
or some variation on that. What I would consider an actual change would be either aThing
property changing, or the RealmListSubThings
being modified (add, remove).it would be nice to have the subscribe method something like.
RealmCollection.SubscribeForNotifications(Callback, notifyLinkedObjectUpdated: false)
The text was updated successfully, but these errors were encountered: