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

Introduce UI State models #277

Merged
merged 2 commits into from
Mar 11, 2023
Merged

Introduce UI State models #277

merged 2 commits into from
Mar 11, 2023

Conversation

yschimke
Copy link
Collaborator

Avoid using dataAssertNoErrors. Instead have a model with Loading, Success, Error.

Follow up work to improve errors and loading.

@martinbonnin
Copy link
Collaborator

Very cool 👍

Avoid using dataAssertNoErrors

FWIW, I'm not super happy with this dataAssertNoErrors and with error handling in general.
It's not easy because of partial data and stuff like "GraphQL errors returning 200" but we put some thoughts over there: apollographql/apollo-kotlin#4711

@joreilly joreilly merged commit 63a690f into joreilly:main Mar 11, 2023
@yschimke
Copy link
Collaborator Author

+1 to making errors just another state. Not sure what I want, but some random thoughts.

I'm not sure what I want, but I think something like https://github.com/skydoves/sandwich, with an additional Loading state would work really well for Compose screens.

We found this section abstraction for screens useful.

https://github.com/google/horologist/blob/9cb3879ed6b044f702b2b2ad0de06f92e5985a09/sample/src/main/java/com/google/android/horologist/sectionedlist/stateful/SectionedListStatefulScreen.kt#L118-L151

Might be useful if you a screen built from multiple queries, each of which has Loading/Success/Failed states.

@yschimke yschimke deleted the add_state_model branch April 2, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants