Git Product home page Git Product logo

Comments (5)

caiyue1993 avatar caiyue1993 commented on August 18, 2024

Hi @joelkraut , thanks for raising this new issue. Actually I am not very clear of your requirements and need your confirmation. So you want to:

Notify your app of the changed records/objects in the changesOp, right?

from icecream.

insidegui avatar insidegui commented on August 18, 2024

@joelkraut Any reason you can't use regular Realm notifications for this?

from icecream.

joelk avatar joelk commented on August 18, 2024

@caiyue1993: yes, exactly. It could be a notification rather than a completion block, doesn't matter much. Basically I want to be able to act on added/deleted/changed objects once they've been changed from CloudKit.

@insidegui: I'm happy to be wrong here, but I think that would be too general for my purposes. I also do a lot of writing to the database locally (ie not from CloudKit changes), and I don't necessarily want to treat those changes the same way. I don't think Realm notifications provide a mechanism to say in what context the change happened. I could make everything go through the same mechanism, but that might lead to some spaghetti-like code if I'm specifically avoiding acting on new objects when I make them so that a global notification handler can deal with them later.

from icecream.

caiyue1993 avatar caiyue1993 commented on August 18, 2024

@joelkraut Well, I guess that I've known what you wanna do. You want to act differently from data changes from local and data changes from CloudKit.

So:

  • If you don't need to do anything due to the local database change, I suggest you looking at the commitWrite(withoutNotifying:) method in Realm.
  • If you need to do something due to the local database change, why you don't just do something right there yourself?

So in my opinion, IceCream might not need to add this feature for now(If added, that might lead to some spaghetti-like code to IceCream instead).

However, if you insist you could fork this project, do your own changes and use that. 🙂

from icecream.

caiyue1993 avatar caiyue1993 commented on August 18, 2024

I'm gonna close this issue for now. If you have more ideas, we could reopen it. Thanks man!

from icecream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.