We should extend our RxJava support to also include fine-grained notifications. It would be relatively easy to expose as a Pair<RealmResults, ChangeSet>. However naming it might be a bit difficult since asObservable() is already taken.
Some suggestions:
RealmResults<Person> persons = realm.where(Person.class).findAll();
Observable<Pair<RealmResults, OrderedCollectionChangeSet>> obs;
// #1
obs = persons.asChangeSetObservable();
// #2
obs = persons.asObservable(true); // true = fine-grained, false = standard
// #3
obs = persons.asFinegrainedObservable();
// #4
// .... others?
One thing to consider is also that we will get single object notifications in the near future #4101, which will have similar requirements.
Personally I probably favour 1. with a 2. as a close second, both could be re-used for single object notifications I think. Thoughts @realm/java ?
TODO
RxObservableFactory interfaceRealmObservableFactory classRealmList/RealmResultsI'm also wondering how this enhancement affects Rx2 support
It doesn't. RxJava1 vs. RxJava2 is a separate discussion ( #3497 ). E.g. this method might just as well be RxRealm.getChangeSetObservable(realmResults) for RxJava2 support.
I vote asObservable(true) by also keeping asObservable() /without parameters/
Thinking about this. Actually 2) is not really possible since the return type will be very different:
```
Observable
// vs.
Observable
I vote 1)
Do we consider to move RxJava2 support out of realm-java as a separated project at this time?
Fixed by #5089