Hello everyone, Is it possible to hear a `Broadcas...
# coroutines
o
Hello everyone, Is it possible to hear a
BroadcastChannel
out of a
Coroutine
?
I would not like to use
asFlows()
to need to add a Coroutines, scope etc..
p
What do you want to achieve?
o
I'm trying to replace a
PublishSubject
But I don't need to move it to background
I'm sharing strings from a search bar from a
Activity
to two
Fragments
under tabs, using shared view model
Then, each fragment read this value and send it to their own ViewModels to handle this search
p
Then use the lifecycleScope of the fragment to collect the events. Coroutines don't make sense without scopes
o
yeah, If I could, I would like to avoid adding more complexity into my fragments otherwise, I'll do that
p
You could use a regular listener
Copy code
typealias SearchListener = (String) -> Unit
o
yes, would be simpler
Thank you 🙂