code: function createMessageEvent(config) {
    const { type, origin, data, target } = config;
    const messageEvent = new MessageEvent(type, {
      data,
      origin
    });
  
    if (target) {
      messageEvent.target = target;
      messageEvent.srcElement = target;
      messageEvent.currentTarget = target;
    }
  
    return messageEvent;
  }
docs: /*
  Creates a MessageEvent object and extends it to allow full modification of
  its properties.
  
  @param {object} config - within config: type, origin, data and optionally target