We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, each scenario/fragments each have its own state-holder class. This is simply a code repetition and is inconsistent in many places.
The text was updated successfully, but these errors were encountered:
Instead of having a <Fragment>UiState class separately for each UiState, we can have a common generic class like
<Fragment>
sealed class UiState<T>( val data: T? = null, val message: String? = null ) { class Success<T>(data: T) : UiState<T>(data) class Error<T>(message: String?, data: T? = null) : UiState<T>(data, message) class Loading<T> : UiState<T>() class Initial<T> : UiState<T>() }
Where T would be the type of result we would be expecting. And then we can use this wrapper everywhere, thus maintaining the consistency.
Sorry, something went wrong.
Can be parallelly done with compose migration, so currently blocked by that.
thedroiddiv
No branches or pull requests
Currently, each scenario/fragments each have its own state-holder class. This is simply a code repetition and is inconsistent in many places.
The text was updated successfully, but these errors were encountered: