[ACCEPTED]-How to document an event handler in JSDoc?-jsdoc
Accepted answer
The keyword is @listens
Usage example:
/**
* Outputs the event that happened
*
* @param {MyEvent} e - The observable event.
* @listens MyEvent
*/
function myEventLogger(e) {
console.log(e);
}
The corollary 1 is the @fires keyword for raising the event.
No, there is no way to document an event handler.
So the best way is to document it as a normal 7 function maybe writing in its description 6 in bold text or upper case that is an "EVENT 5 HANDLER".
You probably already now this, but 4 just in case: you can write it in bold by 3 simply wrapping the text into html tags 2 <strong></strong>
.
This answer is now deprecated but it does 1 not let me delete it.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.