Git Product home page Git Product logo

Comments (1)

jvisenti avatar jvisenti commented on June 2, 2024

Hi @zackhsuan, the library explicitly doesn't provide support for blocks for two reasons:

  1. Block-based KVO invariably leads to memory management issues if you're not very careful, and these issues are hard to track down
  2. If you add a block-based observer, it becomes impossible to selectively unregister actions. This is because there is no way to compare blocks the than pointer equality. A solution for this would be to return some handle on the observer, which can be used to unregister later. See the NSNotificationCenter addObserverForName: object: queue: usingBlock: API for reference. Currently the observer object is an implementation detail, and I'd rather not leak that in the public interface.

Happy to discuss more details of the decision to not support a block API, but I'm closing this issue for now

from rzdatabinding.

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.