code: public function onUpdate(ResourceEventInterface $event)
      {
          $item = $this->getShipmentItemFromEvent($event);
          $shipment = $item->getShipment();
  
          $this->preventSaleItemChange($item);
  
          // Check whether or not the stock impact has been made by the shipment listener
          if (!empty($stateCs = $this->persistenceHelper->getChangeSet($shipment, 'state'))) {
              // If shipment just did a stockable state transition
              if (
                  Model\ShipmentStates::hasChangedFromStockable($stateCs) ||
                  Model\ShipmentStates::hasChangedToStockable($stateCs)
              ) {
                  // Abort (done by the shipment listener)
                  return;
              }
          }
  
          // If shipment is in a stockable state and quantity has changed
          if (
              Model\ShipmentStates::isStockableState($shipment->getState()) &&
              $this->persistenceHelper->isChanged($item, 'quantity')
          ) {
              // Apply shipment item to stock units
              $this->stockUnitAssigner->applyShipmentItem($item);
  
              $this->scheduleShipmentContentChangeEvent($shipment);
          }
      }
docs: Update event handler.
  
  @param ResourceEventInterface $event