// 事件总线第三方库：
import mitt from 'mitt'
const bus = mitt()

export const busEmit = (name, params) => {
  return new Promise((resolve, reject) => {
    bus.emit(name, async(val) => {
      const data = await val
      resolve(data)
    })
  })
}

export default bus
