So I would like to make a general function to subscribe to any event, because my component might subscribe to more than one event.
Does this work with EventBus?
@Subscribe(threadMode = ThreadMode.BACKGROUND)
fun subscribeToAnything(event : Any) {
when(event) {
is EventA -> // do something for event A
is EventB -> // do something for event B
}
}
So I would like to make a general function to subscribe to any event, because my component might subscribe to more than one event.
Does this work with EventBus?
Thanks in advance.