packages/mip/src/util/dom/event.js
function createEvent (type, data) {
  let event = document.createEvent(specialEvents[type] || 'Event')
  event.initEvent(type, true, true)
  data && (event.data = data)
  return event
}
function createEvent (type, data) {
  let event = document.createEvent(specialEvents[type] || 'Event')
  event.initEvent(type, true, true)
  data && (event.data = data)
  return event
}
function createEvent ( type , data ) { let event = document . createEvent ( specialEvents [ type ] || 'Event' ) event . initEvent ( type , true , true ) data && ( event . data = data ) return event }
Create a event object to dispatch

@param {string} type Event name
@param {?Object} data Custom data
@return {Event}
Create a event object to dispatch