Zun
06/06/2021, 1:41 PMonEmpty{emit(null)}
doesn't workknthmn
06/06/2021, 2:01 PMFlow.onEmpty()
runs the lambda when the flow finishes without emitting any elements, it has nothing to do with the list being emptyshowDao.loadHomeScreen()
, you can just use Flow.map()
Zun
06/06/2021, 2:02 PMknthmn
06/06/2021, 2:02 PMshowDao.loadHomeScreen().map { it.takeIf { it.isNotEmpty() } }