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
It appears that the following code is undocumentable with ESdoc (using the node.js EventEmitter):
class Example extends EventEmitter {
doSomething () {
....then( () => this.emit('anevent', params) )....
}
// and many other methods that can also emit various events defined by this class
}
Here, the anevent event is associated with the class Example, not with any particular method of it. Multiple methods may emit that event, and the API is designed such that it doesn't matter what method emits the event (this is the intent of events to begin with), as on('anevent', ...) would be called on an Example instance, not on the return value of some particular method.
Also, this code simply uses the functionality of the base EventEmitter, it does not define any custom event code that can itself serve as a documentation target.
In other words, events are a property of the class Example, and not of anything else.
However, ESdoc does not seem to recognize @emits in class documentation, only in method documentation, even though it is the class that emits the events.
Is there a way to document this type of code with ESdoc?
The text was updated successfully, but these errors were encountered:
It appears that the following code is undocumentable with ESdoc (using the node.js EventEmitter):
Here, the
anevent
event is associated with the classExample
, not with any particular method of it. Multiple methods may emit that event, and the API is designed such that it doesn't matter what method emits the event (this is the intent of events to begin with), ason('anevent', ...)
would be called on anExample
instance, not on the return value of some particular method.Also, this code simply uses the functionality of the base
EventEmitter
, it does not define any custom event code that can itself serve as a documentation target.In other words, events are a property of the class
Example
, and not of anything else.However, ESdoc does not seem to recognize
@emits
in class documentation, only in method documentation, even though it is the class that emits the events.Is there a way to document this type of code with ESdoc?
The text was updated successfully, but these errors were encountered: