Skip to content

Instantly share code, notes, and snippets.

@motorro
Last active August 7, 2022 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motorro/ed2dcd878204baa1dd2697746e3b899d to your computer and use it in GitHub Desktop.
Save motorro/ed2dcd878204baa1dd2697746e3b899d to your computer and use it in GitHub Desktop.
Inter-state data passing
class CredentialsCheckState(data: LoginDataState): CoroutineState<LoginGesture, LoginUiState>() {
/**
* Should have valid email at this point passed with inter-state data
*/
private val email = requireNotNull(data.commonData.email) {
"Email is not provided"
}
/**
* Should have valid password at this point passed with inter-state data
*/
private val password = requireNotNull(data.password) {
"Password is not provided"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment