MCPcopy Create free account
hub / github.com/esengine/esengine / emit

Method emit

packages/core/src/Utils/Emitter.ts:63–70  ·  view source on GitHub ↗

* 触发该事件 * @param eventType 事件类型 * @param data 事件数据

(eventType: T, ...data: TData[])

Source from the content-addressed store, hash-verified

61 * @param data 事件数据
62 */
63 public emit<TData = unknown>(eventType: T, ...data: TData[]) {
64 const list = this._messageTable.get(eventType);
65 if (list) {
66 for (const observer of list) {
67 observer.func.call(observer.context, ...data);
68 }
69 }
70 }
71
72 /**
73 * 判断是否存在该类型的观察者

Callers 6

build_pluginFunction · 0.45
install_esbuildFunction · 0.45
watch_scriptsFunction · 0.45
watch_assetsFunction · 0.45
EventBus.test.tsFile · 0.45

Calls 1

getMethod · 0.65

Tested by

no test coverage detected