This message was deleted.
# compose
s
This message was deleted.
👍 1
a
Agreed. The fact that you must specify an initial value when calling
collectAsState()
on a
Flow
also brings out this problem.
1
s
Since both sources of the combine are StateFlows, the resulting combine always has some current value. Would this not work?
Copy code
suspend fun doSomethingScary1() {
   if (!canDoSomethingScary.first()) return
   // do something scary
}
instead of using
stateIn
?
c
🤦
k
@streetsofboston, yes, you can, but it will still be suspended that is extra here.
s
True, I though that'd be fine, since the calling function
doSomethingScary1
is suspend as well.
k
I will remove this post and you can ask your questions in #coroutines channel or, that is better, on GitHub.