Tower Guidev2
12/17/2021, 1:50 PMmyAdapter.loadStateFlow
.distinctUntilChangedBy { it.refresh }
.filter { it.refresh is LoadState.NotLoading || it.refresh is LoadState.Error }
.collectLatest { loadState ->
// .. use loadState value to display correct layout
}
loadState
which i thought would be given to my collectLatest
block
however I recive additional values that I would like to filter out some how
is it possible to collectLatest the "actual" latest value?
I improved the situation somewhat by adding .debounce(100L)
however I do not like this use of "magic values" as
by adding this instruction i experience intermittent layout issues, e.g. my loading progress spinner is shown permanentlyJoffrey
12/17/2021, 5:28 PMTower Guidev2
12/22/2021, 2:41 PM