This message was deleted.
# coroutines
s
This message was deleted.
j
Do you have a
Flow
or a
StateFlow
? If a plain
Flow
, what do you mean by "its value"?
t
it is a flow
I mean if it is true or false
j
A
Flow
is a stream of values, so if you have a
Flow<Boolean>
it's not obvious which boolean value you're talking about. Do you mean the first emitted value upon collection?
t
yes
j
I guess the comments and answers on the SO question summarize what I wanted to say pretty well already
t
thanks Joffrey Bion I really I appreciate your help
🤔 1
j
What is your
Flow
backed by? How are values produced? This might help me understand why it makes sense for you to talk about "the value" of the flow
If you want the first value, you could always do
runBlocking { flow.first() }
but it's almost certainly wrong to do so, hence why I'm trying to grasp your particular use case better
👍 1
thanks Joffrey Bion I really I appreciate your help
Is that sincere or passive-aggressive?
t
of course that is sincere, you already answered my question (runBlocking { flow.first() })
j
Ok, that message was before, though. Hence my question
Note that I told you this solution was very likely a wrong solution. Most likely using a
StateFlow
instead would be more appropriate if you want to access a "current value" but also have observability.