Last active
November 19, 2020 08:32
-
-
Save Shivamdhuria/7198e2bc00afe0cdbd74e47076fe52a3 to your computer and use it in GitHub Desktop.
This file contains 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
val isSubmitEnabled: Flow<Boolean> = combine(_firstName, _password, _userID) { firstName, password, userId -> | |
val regexString = "[a-zA-Z]+" | |
val isNameCorrect = firstName.matches(regexString.toRegex()) | |
val isPasswordCorrect = password.length > 8 | |
val isUserIdCorrect = userId.contains("_") | |
return@combine isNameCorrect and isPasswordCorrect and isUserIdCorrect | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment