智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/18/184171b790e77e2d20a17408cca...

22 lines
513 B

let getEmitter
function apply (ctx, method, args) {
return ctx[method].apply(ctx, args)
}
export function $on () {
return apply(getEmitter(), '$on', [...arguments])
}
export function $off () {
return apply(getEmitter(), '$off', [...arguments])
}
export function $once () {
return apply(getEmitter(), '$once', [...arguments])
}
export function $emit () {
return apply(getEmitter(), '$emit', [...arguments])
}
export default function initEventBus (getGlobalEmitter) {
getEmitter = getGlobalEmitter
}