-
Notifications
You must be signed in to change notification settings - Fork 202
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
[Proposal] Simplify StoreResponse by Replacing Loading and NoNewData with a isFetcherActive
flag in Data
#230
Comments
isFetcherAcive
flag in DataisFetcherActive
flag in Data
While we are removing states, why do we need 2 error states? I think after quick look, I did not even find |
I've open #231 for discussing the error states. we do need to handle non throwable error propagation because we don't want to force our users to have to use exceptions to propagate errors. |
Is there a case when a first response in the stream would be an
To avoid this confusion, maybe we could, instead of adding a flag, add a new state |
this feels like making stream not a stream of events anymore. Feels very similar to what we wanted to do very early on and we decided not to since this information can be kept with a simple stream fold operation. something like.
The helper would handle restart of the stream (using the trigger mentioned in #124 ) but also keep previous data. Usage would be like:
|
here is a quick and dirty prototype: |
I'm a fan of externalizing the UIState controller similar to what Yigit proposed above. Closing for now |
API update proposal:
Some of the alpha feedback we've gotten is that there are too many states to handle under
StoreResponse
.We currently have the following
Loading
NoNewData
Data
Error.Message
Error.Exception
I propose we drop Loading and NewNewData and instead add a
isFetcherActive
flag to Data (and maybe also Error) that can be used by the users to know whether to show a spinner (or whatever they are using the loading flag for right now).The isFetcherActive will only mirror the state of the original fetch associated with the
stream
and will not flip back and forth if subsequent steam calls are made that re-trigger the fetcher (thus preserving the existing Loading/NoNewData behavior)As a bonus this will also eliminate the 2 states of StoreResponse that are only valid for origin=fetcher.
The text was updated successfully, but these errors were encountered: