val input: MutableLiveData<Int> = MutableLiveData(initialValue = 2)
val output: LiveData<String> = input.flatMapBuffered { current, new ->
MutableLiveData("$current:$new")
}
we now got output after initialization with value 2:2 and it can be invalid - we have only 1 value in real, so we should pass in current null and in new - initial value. null:2 should be i think
With this code:
we now got
output
after initialization with value2:2
and it can be invalid - we have only 1 value in real, so we should pass incurrent
null and innew
- initial value.null:2
should be i think