Skip to content

Instantly share code, notes, and snippets.

@lukaszkalnik
Last active July 20, 2022 16:31
Show Gist options
  • Save lukaszkalnik/0432d152e30c32447c9447ffe840c8e0 to your computer and use it in GitHub Desktop.
Save lukaszkalnik/0432d152e30c32447c9447ffe840c8e0 to your computer and use it in GitHub Desktop.
sealed class DataState<T> {
sealed class DataMissing : DataState<Nothing>() {
object NotInitialized : DataMissing()
data class Error(cause: Exception) : DataMissing()
}
data class DataLoaded<T>(val data: T) : DataState<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment