mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Update: AppVM'S products list non-nullable
This commit is contained in:
parent
48d874d2d8
commit
1a2e25c112
@ -10,12 +10,12 @@ import com.looker.droidify.database.entity.Repository
|
||||
|
||||
class AppViewModelX(val db: DatabaseX, val packageName: String) : ViewModel() {
|
||||
|
||||
val products = MediatorLiveData<List<Product?>>()
|
||||
val products = MediatorLiveData<List<Product>>()
|
||||
val repositories = MediatorLiveData<List<Repository>>()
|
||||
val installedItem = MediatorLiveData<Installed?>()
|
||||
|
||||
init {
|
||||
products.addSource(db.productDao.getLive(packageName), products::setValue)
|
||||
products.addSource(db.productDao.getLive(packageName)) { products.setValue(it.filterNotNull()) }
|
||||
repositories.addSource(db.repositoryDao.allLive, repositories::setValue)
|
||||
installedItem.addSource(db.installedDao.getLive(packageName), installedItem::setValue)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user