Map LiveData> to LiveData>

前端 未结 1 1722
隐瞒了意图╮
隐瞒了意图╮ 2021-02-12 08:40

I need to map domain objects to UI objects and display using a live paged list.

I have tried to map LiveData> to LiveData<

相关标签:
1条回答
  • 2021-02-12 09:22

    DataSource and DataSource.Factory have mapBy() and mapPageBy(), which could help you in this case. Just be careful cause these two will restrict the size of the "Y"-result-list.

    If the size of the result differs from the original list's size then DataSource will throw an Exception.

    0 讨论(0)
提交回复
热议问题