MCPcopy
hub / github.com/wechat-miniprogram/miniprogram-demo / on

Function on

miniprogram/packageSkyline/utils/event-bus.js:3–6  ·  view source on GitHub ↗
(eventName, handler)

Source from the content-addressed store, hash-verified

1const map = {}
2
3function on(eventName, handler) {
4 map[eventName] = map[eventName] || []
5 map[eventName].push(handler)
6}
7
8function off(eventName, handler) {
9 const handlerList = map[eventName]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected