How to document an event emitter returned

不想你离开。 提交于 2019-12-05 07:51:30
Jasmine Hegman

You can document these behaviors by documenting your events (event1, event2, ...) as @event MyFunc#event1 and MyFunc, or whoever does the emitting, with @fires MyFunc#event1.

You can also document functions that listen to those events with @listens MyFunc#event:event1.

Here are the official JSDoc pages for the aforementioned tags:

Do note some nuance around "event" mentioned in the tags event page, repeating here:

JSDoc automatically prepends the namespace event: to each event's name. In general, you must include this namespace when you link to the event in another doclet. (The @fires tag is a notable exception; it allows you to omit the namespace.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!