Closed denmusic1992 closed 3 years ago
I'm trying to set a new data to pagination when clearing items. When items list is empty, I need to set pagination state = Empty But it's not working as I expected. There are setDataSuspend and asStateNullIsEmpty methods:
setDataSuspend
asStateNullIsEmpty
suspend fun setDataSuspend(items: List<Item>?) { listMutex.lock() mStateStorage.value = items.asStateNullIsEmpty() mEndOfList.value = false listMutex.unlock() } fun <T, E> T?.asStateNullIsEmpty() = asState { ResourceState.Loading<T, E>() }
It would be great when passing emptyList to pagination we will get an Empty Resource State in it.
I'm trying to set a new data to pagination when clearing items. When items list is empty, I need to set pagination state = Empty But it's not working as I expected. There are
setDataSuspend
andasStateNullIsEmpty
methods:It would be great when passing emptyList to pagination we will get an Empty Resource State in it.