Hello, is there a way to declare a stateFlow witho...
# coroutines
a
Hello, is there a way to declare a stateFlow without an initial value ?
z
Nope. The contract of
StateFlow
is that it always must have a value.
That initial value can be
null
though if your state type is otherwise non-nullable.
👍 5
g
You also can apply filterNonNull() operator, so consumer will receive only non null values and only when it initialized
👍 7