MobileNativeFoundation / MobileNativeFoundation/Store

[Feature Request] The stream of StoreResponse<T> should emit Loading(origin = SourceOfTruth)

Open
#566 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.