Skip to content

Instantly share code, notes, and snippets.

@volodymyr-sch
Created October 18, 2021 15:16
Show Gist options
  • Select an option

  • Save volodymyr-sch/024693814785ccbfabc41e5c5c6b1742 to your computer and use it in GitHub Desktop.

Select an option

Save volodymyr-sch/024693814785ccbfabc41e5c5c6b1742 to your computer and use it in GitHub Desktop.
//Not ok
sealed class MyState {
object ShowProgressBar: MyState()
data class ShowDataWithError(val error: Throwable?, val data: List<Item>): MyState()
}
//Good
data class MyState(
val isShowProgress: Boolean = false,
val error: Throwable? = null,
val data: List<Item>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment