Skip to content

Instantly share code, notes, and snippets.

View amin3536's full-sized avatar

amin mirmahmoudi amin3536

View GitHub Profile
@amin3536
amin3536 / EventBus.kt
Created July 9, 2020 06:43 — forked from DaleLaw/EventBus.kt
Implement EventBus with Kotlin coroutine
object EventBus {
val bus: BroadcastChannel<Any> = BroadcastChannel()
fun send(o: Any) {
launch {
bus.send(o)
}
}