Created
November 22, 2020 14:39
-
-
Save makorowy/b6a89d1d978703f803f84c56d6c17710 to your computer and use it in GitHub Desktop.
[BLOG] Example of contract between ViewModel and View
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
data class ViewState( | |
val firstName: String, | |
val lastName: String, | |
val notificationsChecked: Boolean, | |
val notificationsEnabled: Boolean | |
) | |
sealed class Interaction { | |
data class NotificationSwitchChanged(val enabled: Boolean) : Interaction() | |
data class FirstNameChange(val firstName: String) : Interaction() | |
data class LastNameChange(val lastName: String) : Interaction() | |
object NotificationSettingButtonClick : Interaction() | |
object HelpButtonButtonClick : Interaction() | |
object LogOutButtonClick : Interaction() | |
object AdvancedSettingsButtonClick : Interaction() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment