Sam
01/20/2021, 7:09 AMrook
01/20/2021, 7:46 PMSam
01/21/2021, 1:52 AMWhat have you tried?
1. I have get data from Room and show it to UI
2. Call API with Zip
get Data from Network and save the result to Room
3. Update lasted data to UI again.
=> so I want to combine 3 steps to one function/stream.StavFX
01/27/2021, 1:01 AMSam
01/29/2021, 2:36 PMStavFX
01/29/2021, 9:38 PMdistinctUntilChanged
to make sure you are not propagating duplicate data to the ui.
And you can use DiffUtils to load the full list into the UI without "reloading" the entire recyclerview (or whatever the ui layer is doing with the data).
Having said all that, I've never actually built a chat-like feature and there might be a better way to do this (the Paging 2/3 library might be worth looking into)rook
01/30/2021, 7:09 PM