Skip to content

Instantly share code, notes, and snippets.

@motorro
Created July 31, 2022 18:27
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/85247c19a8b3ef592ad45147f4846bb3 to your computer and use it in GitHub Desktop.
Save motorro/85247c19a8b3ef592ad45147f4846bb3 to your computer and use it in GitHub Desktop.
Injecting use-case to your state
class CredentialsCheckState(private val checkCredentials: CheckCredentials) {
// State logic
override fun doStart() {
stateScope.launch {
// Runs use-case
val valid = checkCredentials()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment