Skip to content

Instantly share code, notes, and snippets.

@motorro
Last active August 7, 2022 19:23
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/39de11c1bd5e303b66db15195c86f342 to your computer and use it in GitHub Desktop.
Save motorro/39de11c1bd5e303b66db15195c86f342 to your computer and use it in GitHub Desktop.
Dedicated state factory
class CredentialsCheckState(
data: LoginDataState,
private val checkCredentials: CheckCredentials
) : CoroutineState<LoginGesture, LoginUiState>() {
// State logic
/**
* Dedicated state factory
*/
@LoginScope
class Factory @Inject constructor(private val checkCredentials: CheckCredentials) {
operator fun invoke(): CoroutineState<LoginGesture, LoginUiState>() = CredentialsCheckState(
checkCredentials
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment