What is the best practice of using a room with RxJava?

I tried my hands on Room and RxJava. I am new to both. My code works fine, but I was interested to learn about best practices.

Imagine an object with 10 fields, say CompleteSong . In my application, I return the number a Flowable<List<CompleteSong>> Whenever I do an update in the database, Flowable updates all the values. I am showing this list with RecyclerView . I have two options: ie

1. I can save the object that is changing and wait for the Flowable to update. When current updates update 1 RecyclerView item

2. I can update RecyclerView when Flowable updates the parsing in the list and is looking for a modified instance of CompleteSong

I used the previous approach, it was less reactive, but optimized, while the latter, apparently, more reactive, but at the same time less optimized.

Can someone teach me what to do? What approach should I take, or something else that I could not find.

Note: I am new to reacting, so please consider updating my terminology if I messed up something.

+8
android kotlin rx-java2 android-room
source share

No one has answered this question yet.

See related questions:

5641
What is the difference between "px", "dip", "dp" and "sp"?
1844
What is "Context" on Android?
1177
What is the difference between match_parent and fill_parent?
1152
The difference between gravity and layout_gravity on Android
652
What are the best practices for SQLite on Android?
603
Best practice for instantiating a new Android snippet
one
Transactions in the Android room w / RxJava2
one
RxJava 2 - monitoring additions and deletions from a list
0
Android room request when changing database
0
RxJava Room with fluid: only return newlines only

All Articles