addChangedTypeToTransaction = (transaction, type, parentSub) => {
  const item = type._item;

  if (item === null || item.id.clock < (transaction.beforeState.get(item.id.client) || 0) && !item.deleted) {
    map.setIfUndefined(transaction.changed, type, set.create).add(parentSub);
  }
}
If `type.parent` was added in current transaction, `type` technically
did not change, it was just added and we should not fire events for `type`.

@param {Transaction} transaction
@param {AbstractType<YEvent>} type
@param {string|null} parentSub