Hi everyone
I'm trying use Event bus pattern in compose but i can not collect event in launchEffect when data is pushed. I make similar in native android it's OK but not working in compose. Somebody can give me the reason this bug?
z
Zach Klippenstein (he/him) [MOD]
08/22/2023, 6:54 PM
What is the bug exactly? In what way is it not working?
t
Toan Nguyen
08/23/2023, 1:53 AM
@Zach Klippenstein (he/him) [MOD] log in subscribe not show i think the block not working
z
Zach Klippenstein (he/him) [MOD]
08/24/2023, 6:08 PM
Where is the
coroutineScope
coming from that you’re using to launch the publish? That scope might be getting cancelled by the navigateUp operation.
Zach Klippenstein (he/him) [MOD]
08/24/2023, 6:10 PM
In general though, event busses for navigation (and most things) are bad, especially global busses, and here it also looks like you might have two sources of truth (navController and the bus), which is also bad.