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
Notifying CollectionDataProvider of updates in a child model #89
Comments
Hmmm...ok, so I'm not 100% sure I understand the question, but what you want to do should definitely be possible. You said: 'Consistency manager only notifies CollectionDataProviderDelegate if CollectionDataProvider has been updated via set setData()'. The consistency manager notifies the delegate if the model is updated anywhere. This could happen in a few ways:
In this case, you should get a delegate callback. So, you shouldn't need to do any of those steps to get updates. It should 'just work'. If it's not working for you, could you share some code and I can see if I see some problem with the setup? |
p.s. getting late where I am, so may respond in the morning :D |
Thanks for the reply, Peter. That's right, what I wanted/expected was calling |
Yes. Note that if you call |
And yes, this includes child models. |
DataModelManager's updateModel() indeed does the trick. I guess this was too easy to not overcomplicate things. Thanks. |
You're welcome. Let me know if you have any questions integrating the library. I'll try to respond quickly :D. |
Thanks for the library. In my experience it has been a joy to migrate to from CoreData-based caching. The documentation is great too, especially in terms of general concepts and setup. What would make it even better is a few use pattern examples or a sample project as people mentioned before. Otherwise it is easy sometimes to fall into overthinking. |
There is a basic sample project in the repo, but it could use a few more complex examples. And it has been a while since I’ve updated the documentation so it’s probably time.
…On Thu, Nov 22 2018 at 9:22 PM, < ***@***.*** > wrote:
Thanks for the library. In my experience it has been a joy to migrate to
from CoreData-based caching. The documentation is great too, especially in
terms of general concepts and setup. What would make it even better is a
few use pattern examples or a sample project as people mentioned before.
Otherwise it is easy sometimes to fall into overthinking.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub (
#89 (comment) ) ,
or mute the thread (
https://github.com/notifications/unsubscribe-auth/ABMNTaT-cPDDFnQ94CXhLeBXT1qaaWqiks5uxrNDgaJpZM4YtdMW
).
|
Here's what I am struggling to get my head around. Suppose we have these models
and
CollectionDataProvider<Message>()
in a view controller. AFAIU, Consistency manager only notifiesCollectionDataProviderDelegate
ifCollectionDataProvider
has been updated via setsetData()
. So far, so good.Now I want my view controller to be notified if User model has been updated from somewhere else. As described here: https://github.com/plivesey/ConsistencyManager-iOS/#how-it-works
There seem to be no method
listenForUpdates(self)
in Consistency Manager. I presume it was replaced withaddListener
. But it sounds like I shouldn't use CM directly, because Rocket Data does it for us. The way it is done in my understanding is viaDataProvider
. Now in the example individual Message models are provided by CollectionDataProvider already. What is the correct approach to listen to User model updates, so that a corresponding Message can be refreshed in the view controller?This scenario is mentioned in Peter's presentation and somewhere else, but I couldn't find a proper example or figure this out. Thanks.
The text was updated successfully, but these errors were encountered: