如何继续监听组合列表中2个可流动列表的变化?

How can I continue to listen changes of 2 flowable list in the combined list?

我有两个Flowable列表 我需要将它们结合起来,应用一些功能并获得 Flowable 列表 初始的 Flowable 列表表示来自数据库的数据 这个想法是,当数据库中可以更改时,可以更改组合列表以及更改输入。 我猜 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)}

考虑Flowable.combineLatest(stream1, stream2, combineBiFunc)。 如果 stream1 结束,stream2 仍将使用 stream1 的最后一个已知列表生成排放(反之亦然)。在 combineBiFunc 中,您可以决定如何处理更新后的数据。