To chain or not to chain methods of the Callbacks Object?
Because it is tempting to use "undocumented internals that some people have cleverly reverse engineered", here is an observation.
In jQuery 1.7 and 1.8, you can call in a chain 7 methods of the Callbacks Object which return this.
http://jsfiddle.net/mpedrotti/uW82R/
Noticing this (pardon the pun ;-) I chained methods to set up callbacks for symmetric observers:
publish = callbacks.add(subscribe).fire; // simplified example
When I reviewed the API documentation this week, I noticed:
* The pages for fired, has, locked say Returns: Boolean
* The pages for add, disable, empty, fire, fireWith, lock, remove say Returns: undefined
* The page for jQuery.Callbacks omits Returns at the upper right
Which would you say is the situation? Not criticizing, just asking.
* The documentation (so far) omits mention of an intended behavior of the Callbacks Object.
* The implementation (so far) has an undocumented behavior which might not have been intended.
The callbacks object has been very helpful. Thank you for providing it as a public interface.