Dispatching custom events
Javascript
document.body.dispatchEvent(new CustomEvent('modal-update', {
  bubbles: true,
  detail: {
    text: val
  }
}))