Created
January 15, 2021 15:35
-
-
Save manuelvicnt/34bbc0f31221caa8dbeba40640817f82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ViewModelScoped // Scopes type to the ViewModel | |
class UserInputAuthData( | |
private val handle: SavedStateHandle // Default binding in ViewModelComponent | |
) { /* Cached data and logic here */ } | |
class RegistrationViewModel( | |
private val userInputAuthData: UserInputAuthData, | |
private val validateUsernameUseCase: ValidateUsernameUseCase, | |
private val validatePasswordUseCase: ValidatePasswordUseCase | |
) : ViewModel() { /* ... */ } | |
class LoginViewModel( | |
private val userInputAuthData: UserInputAuthData, | |
private val validateUsernameUseCase: ValidateUsernameUseCase, | |
private val validatePasswordUseCase: ValidatePasswordUseCase | |
) : ViewModel() { /* ... */ } | |
class ValidateUsernameUseCase( | |
private val userInputAuthData: UserInputAuthData, | |
private val repository: UserRepository | |
) { /* ... */ } | |
class ValidatePasswordUseCase( | |
private val userInputAuthData: UserInputAuthData, | |
private val repository: UserRepository | |
) { /* ... */ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment