-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Labels
Description
Since Realm 10.12.0, function observe can receive keyPaths parameter, which can select object properties object or collection.
https://docs.mongodb.com/realm/sdk/ios/examples/react-to-changes/#register-a-key-path-change-listener
I want to write code with RxRealm like below 😍 :
Observable.changeset(from: dogs, keyPaths: ["favoriteToy", "age"])
.subscribe(onNext: { results, changes in
if let changes = changes {
// it's an update
print(results)
print("deleted: \(changes.deleted)")
print("inserted: \(changes.inserted)")
print("updated: \(changes.updated)")
} else {
// it's the initial data
print(results)
}
})