Zhuinden / realm-monarchy

[ACTIVE-ISH] A wrapper over Realm which exposes it as LiveData, managing Realm lifecycle internally.
Apache License 2.0
88 stars 11 forks source link

Nullable OrderedCollectionChangeSet #13

Closed shynline closed 6 years ago

shynline commented 6 years ago

hi how does the NonNull getOrderedCollectionChangeSet() return a Nullable OrderedCollectionChangeSet ?

I've read it in the official realm document about OrderedCollectionChangeSet

null means the async query returns the first time.

Zhuinden commented 6 years ago

That changed with Realm 5.0.0 and it previously used to return null instead of changeSet.getState() == INITIAL.

So if you're using latest version of Realm, that's nonnull.

See https://github.com/Zhuinden/realm-monarchy/blob/831ab834ed304385143f0918d7694abc42421c7a/monarchy-example/src/main/java/com/zhuinden/monarchyexample/features/managed/MonarchyDiffResult.java#L23

shynline commented 6 years ago

oh ok then I was wondering why it's working. thanks