MobileNativeFoundation / MobileNativeFoundation/Store
[Feature Request] The stream of StoreResponse<T> should emit Loading(origin = SourceOfTruth)
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 3.4k
- Forks
- 217
- Avg merge
- 18m
- Merged PRs (30d)
- 4
Description
Currently whenever we call Store.stream(StoreRequest.cached...)...) the only Loading we get is that of a Fetcher. This means that if we create a UI state folding the stream of StoreResponses, we can't really know when we are loading stuff from the SourceOfTruth, which is usually fast but not instant. Often we want to show a loading not only when we are fetching data but also while retrieving data from the source of truth.
The solution would be to add the emission of a Loading store response with the origin set to SourceOfTruth which retrieving data. This way we can be more granular the way we handle loading states.
Note: This refers to Store4 (4.0.5).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Store.stream(StoreRequest.cached(...)) and the SourceOfTruth loading path described in the issue. Confirm where StoreResponse.Loading emissions are created, then verify that source-of-truth retrieval emits Loading with origin SourceOfTruth without changing Fetcher loading behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100