Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FilippoVigani opened this issue Jul 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@FilippoVigani
Copy link

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).

@FilippoVigani FilippoVigani added the enhancement New feature or request label Jul 4, 2023
@digitalbuddha
Copy link
Contributor

I think the initial concern was around disk emitting fairly quickly leading to ui flashing, I'm ok with this going in with some flag in the request that enables it. Let me think about a clean way to do it. Happy to accept a PR as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 Triage
Development

No branches or pull requests

2 participants