Last active
March 1, 2018 07:00
-
-
Save Laimiux/d77a101fcdf47be34c5c12010f5ca1e3 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
sealed class CommentFormUserEvent { | |
data class TextChangedEvent(..): CommentFormUserEvent() | |
data class SubmitCommentRequestEvent(..): CommentFormUserEvent() | |
} | |
sealed class LoginFormUserEvent { | |
// We cannot use TextChangedEvent from CommentFormUserEvent | |
data class TextChangedEvent(..): LoginFormUserEvent() | |
data class LoginRequestEvent(..): LoginFormUserEvent() | |
} | |
// or we could do this, but we still end up with some duplicate logic | |
data class TextChangedEvent(val text: String, /* more properties */ ) | |
sealed class CommentFormUserEvent { | |
data class CommentFormTextChangedEvent(val event: TextChangedEvent): CommentFormUserEvent() | |
data class SubmitCommentRequestEvent(..): CommentFormUserEvent() | |
} | |
sealed class LoginFormUserEvent { | |
// We cannot use TextChangedEvent from CommentFormUserEvent | |
data class LoginFormTextChangedEvent(val event: TextChangedEvent): LoginFormUserEvent() | |
data class LoginRequestEvent(..): LoginFormUserEvent() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment