https://kotlinlang.org logo
#coroutines
Title
# coroutines
s

Simon Lin

03/16/2021, 6:40 AM
Can I suspend get the value by
SharedFlow
(replay is 1) like
Channel::receive
? for example:
Copy code
suspend fun generateSomething() : String {
    val result = _channel.receive() // Change Channel to SharedFlow
    return "Result is $result"
}
a

Alex Vasilkov

03/16/2021, 7:02 AM
I’d say simple
flow.first()
should also work
🙌 3
5 Views