Comments (1)
Hi @zackhsuan, the library explicitly doesn't provide support for blocks for two reasons:
- Block-based KVO invariably leads to memory management issues if you're not very careful, and these issues are hard to track down
- 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)
- Add receptionist pattern HOT 1
- No callImmediately: version of -rz_addTarget:action:forKeyPathChanges: HOT 5
- bind should not emit changes for equal values HOT 2
- Parameter to trigger initial function call for rz_bind:toKeyPath:ofObject:withFunction HOT 5
- Rename RZDBKeyBindingFunction to RZDBKeyBindingTransform
- callImmediately crashes if used with unresolvable key path HOT 2
- rz_addTarget:action: should be smart about KVO options
- Misleading typo in documentation for `RZDB_AUTOMATIC_CLEANUP` HOT 2
- Current podspec is incompatible with OS X HOT 1
- Migrating to 2.0 HOT 1
- Build on Travis
- rz_addTarget:action:forKeyPathChange: is considered an unrecognised selector HOT 2
- Swift support?
- Add RZDB_KP_PROTOCOL HOT 2
- Binding UITextField.text to Model.property HOT 2
- Crashes on [RZDBObserver invalidate] HOT 9
- tvOS support? HOT 1
- Demo can not run in X-code HOT 1
- Age stepper in demo not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rzdatabinding.