Skip to content

Instantly share code, notes, and snippets.

@victory316
Created December 27, 2022 08:44
Show Gist options
  • Save victory316/c8fd4b4261d89dba2189e00a40498c9a to your computer and use it in GitHub Desktop.
Save victory316/c8fd4b4261d89dba2189e00a40498c9a to your computer and use it in GitHub Desktop.
When statement parsing sealed class
when (val result = queryList) {
is Result.Error -> {}
is Result.Loading -> {}
is Result.Success -> {
val mydata = result.data
// ..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment