0
나는 유동성 목록이 두 개 있는데이 두 가지를 결합하여 일부 기능을 적용하고 유동성 목록을 얻을 수있다. 초기 유동성 목록은 DB 의 데이터를 나타내며 생각이 바뀌면 결합 목록이 변경 될 수있다. 입력이 변경됩니다. 일단 zip이 제대로 작동하면 zip은 올바른 접근 방식이 아니므로 변경 사항을 계속해서 내 보내지는 않습니다. 나는,이 목록을 결합하여 일부 기능을 적용하고 업데이트결합 된 목록에서 2 개의 유동성 목록의 변경 사항을 계속 듣고 싶습니다.
Flowable.zip(shoppingListsRepository.loadCommonArticles(), shoppingListsRepository.loadShoppingListItems(shoppingListId),
BiFunction<List<CommonArticle>, List<ShoppingListItem>, List<CommonArticle>> {
commonArticles, shoppingListItems ->
//apply some filters on these two list and return result
items
});
fun loadCommonArticles(): Flowable<List<CommonArticle>> {
return shoppingListDao.loadCommonArticles()
}
fun loadShoppingListItems(shoppingListId:
Int):Flowable<List<ShoppingListItem>> {
return shoppingListDao.loadShoppingListItems(shoppingListId)}
고맙습니다. –