New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should KVO subscribables send their current value on subscribe? #100
Comments
Why not just accept KVO options (which include the option to receive an initial notification)? |
Maybe, but that'd require a bit more support for propagating the change dictionary. Which might be good to have anyways, but seems separate from this particular issue. |
I mostly call it from a macro, so it's easy to switch between I don't think much of my code would break if this behaviour was changed, and even the parts that did break would be trivial to fix, but I'd still rather have the option to choose whether I want the initial value or not, after all you do get the option with vanilla KVO. |
@joshaber The change dictionary is mostly orthogonal — just make it clear you can't get new/old no matter what. Initial and prior options are still really useful. |
Closing this for now. I think the real problem is that it can be hard to know if you need to use |
Why is this? |
I mean that you wouldn't be able to get KVO "diffs", like added/removed objects in an array (obtained from the KVO change dictionary, as generated by |
I'm starting to think
+rac_subscribableFor:keyPath:onObject:
should send the current value of the key path when it is first called. It already replays the last value, but it seems even better to ensure a subscribable for a property will always have the current value, even if it'snil
.The text was updated successfully, but these errors were encountered: