An error occurred while fetching the assigned milestone of the selected merge_request.
The source project of this merge request has been removed.
3 unresolved threads
生命周期监听方法修改,底层主动抛事件修改
25 } 26 let fs = nameMap.get(name) 27 fs.push(cb) 23 28 } 24 29 25 30 /** 26 31 * 移除底层事件监听器 27 * cb(name, param1, param2, ...) 32 * cb(param1, param2, ...) 28 33 */ 29 export const removeEventListener = (type: string, cb: (string, ...params) => void) => { 34 export const removeEventListener = (type: string, name: string, cb: (...params) => void) => { 30 35 if (eventMap.has(type)) { 31 let fs = eventMap.get(type); 36 let nameMap = eventMap.get(type) 37 let fs = nameMap.get(name); 16 17 */ 17 export const addEventListener = (type: string, cb: (string, ...params) => void) => { 18 if (!eventMap.has(type)) eventMap.set(type, []); 19 let fs = eventMap.get(type); 20 if (fs.indexOf(cb) < 0) { 21 fs.push(cb); 18 export const addEventListener = (type: string, name: string, cb: (...params) => void) => { 19 if (!eventMap.has(type)) { 20 eventMap.set(type, new Map<String, Function[]>()) 22 21 } 22 let nameMap = eventMap.get(type); 23 if (!nameMap.has(name)) { 24 nameMap.set(name, []) 25 } 26 let fs = nameMap.get(name) 27 fs.push(cb)