Skip to content

[Feature Request] Support Key Path Change Listener #172

@mtgto

Description

@mtgto

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)
    }
  })

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions