Skip to content

Instantly share code, notes, and snippets.

@krzdabrowski
Last active April 2, 2024 19:11
Show Gist options
  • Save krzdabrowski/ee85d06adc58f1a5a48d887d4be5c00c to your computer and use it in GitHub Desktop.
Save krzdabrowski/ee85d06adc58f1a5a48d887d4be5c00c to your computer and use it in GitHub Desktop.
class EventDelegateImpl<EVENT> : EventDelegate<EVENT> {
private val eventChannel = Channel<EVENT>(Channel.BUFFERED)
override fun getEvents(): Flow<EVENT> = eventChannel.receiveAsFlow()
override suspend fun setEvent(event: EVENT) {
eventChannel.send(event)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment