The cause of #602 is we were not synchronizing updates to single items with the collection they belong to. This PR fixes that by handling the streaming and updating of single item data within a collection.
Other changes:
Introducing Pager, PagingData, Joiner, Streamer, and KeyFactory interfaces. I think this is cleaner, easier to reason about, easier to test.
Moving launchPagingStore into RealPager implementation.
Emitting a state flow of PagingData rather than StoreReadResponse. My thought is this will make it easier to support UI-level extensions, similar to collectLazyPagingItems.
Type of Change
[x] Bug fix (non-breaking change which fixes an issue)
[x] This change requires a documentation update
Test Plan
Unit tests
Checklist:
Before submitting your PR, please review and check all of the following:
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my change is effective
[x] New and existing unit tests pass locally with my changes
Additional Notes:
I removed the original design doc from the source code. It is still attached to the PR that introduced paging. I am working on #595 and plan to include documentation on paging internals.
@digitalbuddha @yigit - I'm launching a child coroutine for each single in a collection. I think this will not scale well for apps with lots of data. We should think about limiting the number of concurrent coroutines and cancellation strategies.
Closes #602
Description
The cause of #602 is we were not synchronizing updates to single items with the collection they belong to. This PR fixes that by handling the streaming and updating of single item data within a collection.
Other changes:
Pager
,PagingData
,Joiner
,Streamer
, andKeyFactory
interfaces. I think this is cleaner, easier to reason about, easier to test.launchPagingStore
intoRealPager
implementation.PagingData
rather thanStoreReadResponse
. My thought is this will make it easier to support UI-level extensions, similar tocollectLazyPagingItems
.Type of Change
Test Plan
Checklist:
Before submitting your PR, please review and check all of the following:
Additional Notes: