-
-
Save skydoves/fda0224451d4f41948ff197aa83836e9 to your computer and use it in GitHub Desktop.
vm_message_event
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
@HiltViewModel | |
class WhatsAppMessagesViewModel @Inject constructor( | |
.. | |
) : ViewModel() { | |
.. | |
fun handleEvents(whatsAppMessageEvent: WhatsAppMessageEvent) { | |
when (whatsAppMessageEvent) { | |
is WhatsAppMessageEvent.FetchChannel -> fetchChannel(whatsAppMessageEvent.channelId) | |
} | |
} | |
} | |
sealed interface WhatsAppMessageEvent { | |
class FetchChannel(val channelId: String) : WhatsAppMessageEvent | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment