nodeEventTarget.emit(type, arg)


  • type <string>

  • arg <any>

  • 返回:<boolean> 如果为 type 注册的事件监听器存在,则为 true,否则为 false

    ¥Returns: <boolean> true if event listeners registered for the type exist, otherwise false.

EventTarget 类的 Node.js 特定扩展,将 arg 分派到 type 的处理程序列表。

¥Node.js-specific extension to the EventTarget class that dispatches the arg to the list of handlers for type.