You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For collection data providers, it'd be great to filter on model changes and insert them into the collection if they meet a certain filter. This would be like predicates in core data.
The text was updated successfully, but these errors were encountered:
Hmmm...looks like this may already be possible with data providers. It looks like you can create a DataProvider and set modelIdentifier. Then, once the model is available, it'll be set onto the data provider.
For the filter method, the easiest way seems to be to do this right after the data changes but before you notify any delegates? And it would just run it on the main thread before notifying listeners?
For listening to certain models for a collection data provider, you could use the consistency manager method:
open func addModelUpdatesListener(_ updatesListener: ConsistencyManagerUpdatesListener) {
modelUpdatesListeners.append(updatesListener)
}
This basically fires for every single model change and so you could filter there. However, threading may be tough. Currently, it runs on the main thread:
The `ConsistencyManagerUpdatesListener` methods are called on the **main thread** for every model updated in the system.
It's recommended to do as minimal processing as possible here so you don't block the main thread.
It's also recommended to have a small number of global listeners.
Maybe it's good enough to just filter on the main thread. Maybe you want to queue them up on a background thread but make sure they're in order (so you always get eventual consistency?)
It would be tough to manage because someone could also change the data on the data provider at any time? So...some ideas...some of this is certainly very tricky, but possible.
For collection data providers, it'd be great to filter on model changes and insert them into the collection if they meet a certain filter. This would be like predicates in core data.
The text was updated successfully, but these errors were encountered: