Open FilippoVigani opened 1 year ago
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
Currently whenever we call
Store.stream(StoreRequest.cached...)...)
the onlyLoading
we get is that of aFetcher
. This means that if we create a UI state folding the stream ofStoreResponse
s, 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 toSourceOfTruth
which retrieving data. This way we can be more granular the way we handle loading states.Note: This refers to Store4 (4.0.5).