callTypeObservers = (type, transaction, event) => {
  const changedType = type;
  const changedParentTypes = transaction.changedParentTypes;

  while (true) {
    // @ts-ignore
    map.setIfUndefined(changedParentTypes, type, () => []).push(event);

    if (type._item === null) {
      break;
    }

    type =
    /** @type {AbstractType<any>} */
    type._item.parent;
  }

  callEventHandlerListeners(changedType._eH, event, transaction);
}
Call event listeners with an event. This will also add an event to all
parents (for `.observeDeep` handlers).

@template EventType
@param {AbstractType<EventType>} type
@param {Transaction} transaction
@param {EventType} event