You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more a question/feature request than a bug report. In ES2015 it is possible to do destructurings directly in the arguments of a function. For example:
varfn=function({prop1, prop2}){// Do something with prop1 and prop2}// fn is called like thisfn({prop1: 1,prop2: 2});
How should the function fn be annotated with JSDoc comments?
Activity
hegemonic commentedon Apr 17, 2015
You can just give the object a fake name and document its properties, like this:
AlexanderZeilmann commentedon Apr 17, 2015
@hegemonic thanks for the quick answer :-)
Hmm, the solution feels a little bit like a hack. But I agree, that is probably the best backwards compatible way to do this.
You might want add this case to the documentation.
qfox commentedon Aug 21, 2015
Sorry for the posting to closed issue but just look:
If we go the usual way it will be:
And it's noisy as hell.
Would be great if we can rethink this.
/cc @blazkovicz
robcolburn commentedon Jan 21, 2016
@hegemonic's #987 (comment) is consistent w/
esdocesdoc/esdoc#178As far as I can tell, it's not documented though. Perhaps, we can be more explicit / borrow from
esdoc?https://esdoc.org/tags.html#object
lll000111 commentedon May 8, 2017
Just for reference, the URL to esdoc documentation posted by @robcolburn just above seems to have changed:
https://esdoc.org/manual/tags.html#object
hegemonic commentedon Jul 3, 2017
I filed jsdoc/jsdoc.github.io#159 to add an example of this to the docs.
add example of documenting destructuring parameters
add example of documenting destructuring parameters (#177)
dandv commentedon Nov 23, 2018
For the record, this is now documented at http://usejsdoc.org/tags-param.html#parameters-with-properties