Hello again, running into an issue trying to combi...
# getting-started
b
Hello again, running into an issue trying to combine live data as flows. When updating livedata objects I am not seeing the combine trigger. Example in thread
Copy code
val flow = combine(first.asFlow(), second.asFlow()){ first, second ->
    first to second
}
...
fun updateFirst(update: String) {
   first.value = update // combine transform is not called
}
I am observing the flow object in my compose screen
m
What is the
first
and why do you think it should emit data to flow?
b
Copy code
val first = MutableLiveData<String>()
Sorry first is a livedata object that is changing
Should an update of that livedata invoke the combine transform in this case, or am I doing this wrong?
m
combine first needs values from all flows before it can transform. I think the Livedata you are passing contain nothing, so they are not emitting. It is also possible that you are not collecting/consuming the flow, so it isn't subscribed to any changes.
b
I am collecting the flow in my screen, but I suspect its an issue with your first observation. Thank you, I will check there