mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
How to observe fetchCount #375
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Feuerwerk on GitHub (Sep 23, 2021).
Hi,
Is there a way in CoreStore to observe the number of records in a table the same way one can use List-/ObjectPublisher or Combine to observe the records itself? In my case i don't want to use the ListPublisher since i don't want to fetch all records when they change and count them. Or does ListSnapshot.count don't fetch all records?
@JohnEstropia commented on GitHub (Sep 23, 2021):
ListSnapshot.count does rely on fetched arrays in order to count them. My suggestion would be to cache this count to one of your entities' property and observe that value instead.
@Feuerwerk commented on GitHub (Sep 24, 2021):
Thanks for your help. :-)