Last active
April 3, 2018 03:02
-
-
Save Laimiux/927d06943133ad50fcf387ca9d0b84f3 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
fun reduce(event: TextChangedEvent, state: CommentFormData): CommentFormData { | |
// Let's check comment validity | |
val isValid = event.enteredText.length > 5 | |
// Update the current state with the changes | |
return state.copy(comment = event.enteredText, isCommentValid = isValid) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment