documenting that on() handler accepts .trigger() args #472#538
documenting that on() handler accepts .trigger() args #472#538mattlunn wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
I think it'd be better to use a more descriptive variable name here. Perhaps person instead of extraParameter.
There was a problem hiding this comment.
Humm. I consciously used that variable name so that it matched the extraParameter variable name in the signature definition at the top of the on() docs; that way it'd be a CTRL + F match for anyone wondering WTF the extraParameter variable was in the signature (as otherwise it wouldn't be searchable).
I'm not sure whether you'd prefer CTRL + F goodness over good variable names; I'm open to change it.
There was a problem hiding this comment.
I personally don't like having demos with bad variable names (demos should show how real code should be written). I'm fine with whatever the consensus is.
There was a problem hiding this comment.
Happy to go with the consensus as well; PR updated to use person instead of extraParameter.
|
@dmethvin, can you please review this, per @scottgonzalez's comment above, so we can merge this in? Thanks. |
|
LGTM! |
|
Updates of this document we need. DefinitelyTyped does not fix the definition unless update the official api document. DefinitelyTyped prohibits the not one argument event handler reason in the official api document. |
|
There was a good example to "extend". Better this seems good. http://api.jquery.com/jQuery.extend/ <argument name="eventObject" type="Event" />
<argument name="extraParameter1" type="Anything" optional="true" rest="true" />
<argument name="extraParameterN" type="Anything" optional="true" rest="true" /> |
|
@falsandtru: Correct me if I'm wrong, but your comments are in reference to your PR DefinitelyTyped/DefinitelyTyped#2843. You've got a point... all jQuery event methods (both the "lower level" Currently, this PR only handles the case for |
|
I ask you to fix because it seems I do not have permission to edit commit this request. |
See #472 for the complete story. Basically;
extraParameterto the signature, and added further documentation as to how it works. It uses therest="true"vararg attribute, which currently doesn't show anything, but support is being added in API Sites: Support for varargs grunt-jquery-content#56on()andtrigger().... all separated into separate commits.