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.
android kotlin rx-java2 android-room
Ankush
source share