addObserver(self) { [weak self] (listPublisher) in
}
however if I add a new article to the corestore, the observer will return more than 10 items.
Originally created by @EricSKCheng on GitHub (Nov 13, 2019).
First I create a ListPublisher
```
CoreStoreDefaults.dataStack.publishList(From<Article>()
.orderBy(.descending(\.publishDate))
.tweak { $0.fetchLimit = 10 })
```
and add a addObserver
```
addObserver(self) { [weak self] (listPublisher) in
}
```
however if I add a new article to the corestore, the observer will return more than 10 items.
This is a limitation of NSFetchedResultsController which also affects ListMonitor.
Fortunately, ListPublishers use diffing instead of relying on FRC update methods, so we can easily simulate the fetch limit by hand.(i.e. just truncate the unwanted items from the snapshot)
I'll post an update soon.
@JohnEstropia commented on GitHub (Nov 13, 2019):
This is a limitation of `NSFetchedResultsController` which also affects `ListMonitor`.
Fortunately, `ListPublisher`s use diffing instead of relying on FRC update methods, so we can easily simulate the fetch limit by hand.(i.e. just truncate the unwanted items from the snapshot)
I'll post an update soon.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @EricSKCheng on GitHub (Nov 13, 2019).
First I create a ListPublisher
and add a addObserver
however if I add a new article to the corestore, the observer will return more than 10 items.
@JohnEstropia commented on GitHub (Nov 13, 2019):
This is a limitation of
NSFetchedResultsControllerwhich also affectsListMonitor.Fortunately,
ListPublishers use diffing instead of relying on FRC update methods, so we can easily simulate the fetch limit by hand.(i.e. just truncate the unwanted items from the snapshot)I'll post an update soon.
@EricSKCheng commented on GitHub (Nov 13, 2019):
Thx.
@JohnEstropia commented on GitHub (Nov 14, 2019):
Implemented in
developbranch 👍