greenrobot / EventBus

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
http://greenrobot.org/eventbus/
Apache License 2.0
24.67k stars 4.66k forks source link

EventBus and Jetpack Compose #697

Open Lingga-MG opened 2 years ago

Lingga-MG commented 2 years ago

Is it possible to use EventBus on Composable function(Jetpack compose)?

Thanks

greenrobot-team commented 2 years ago

Haven't tried. What are the requirements? Do you maybe have a code snippet or link to some docs to explain what you are trying to do?

funyin commented 2 years ago

It's probably possible if the composable has a life cycle that you can use to register and unregister events. Although the subscribers also have to be functions so I am not sure how that would work.