Feature Request: TransformWithInlineUpdate
Is your feature request related to a problem? Please describe.
Well not exactly a problem but it could benefit everyone that's using the DD on mobile (and other platforms too): Shuffling on the lists and unnecessary update of whole item in the UI due to the replacement of items even when their TKey is the same as the previous cached version. That means the items are equal (not the same reference) but only a property has changed.
The issue I'm talking about is mentioned in this issue: #240
The real life case:
In my most recent projects I've been using Akavache as fetcher of data and caching mechanism, and DynamicData to provide the data through my services connecting them through the viewmodels. That's a nice duo, but I'm constantly being hit by the combination of GetAndFetchLatest (gets from the cache and from the remote) + AddOrUpdate/EditDiff because the replacement of items is making my lists to shuffle when a property of the object gets changed on the remote.
Describe the solution you'd like As already discussed in the issue #240 above there are two proposed solutions:
- one is to provide a
Transformthat receives an update action as argument, so that could be implemented for each specific case before presenting the data at the viewmodel level (for my case at least). - the second one is to provide something closer to the cache itself, like the
EditDiffandAddOrUpdate, making use of theEditto perform the update action as passed in.
I think both of these mechanisms would be great additions to the framework. For my case the second one would be the perfect addition, to not have to rely on it as an extension snippet that I copy and paste into my project. With them in place I imagine it would cover most of the cases people are using, having this optimization out of the box to be used. With that we could fine grain how the items would get updated and when.
Describe alternatives you've considered No others for now.
Describe suggestions on how to achieve the feature They are already proposed on the issue #240
Additional context
You have presented the case very well and made a compelling argument to add two these overloads to the main library. This will be fairly easy to implement as there is already sample code. I expect to be able to do this very soon
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.