code: public function onUpdate(ResourceEventInterface $event)
      {
          $stockUnit = $this->getStockUnitFromEvent($event);
  
          $trackProperties = [
              'state',
              'orderedQuantity',
              'receivedQuantity',
              'adjustedQuantity',
              'soldQuantity',
              'shippedQuantity',
              'estimatedDateOfArrival'
          ];
  
          if ($this->persistenceHelper->isChanged($stockUnit, $trackProperties)) {
              if ($this->stateResolver->resolve($stockUnit)) {
                  $this->persistenceHelper->persistAndRecompute($stockUnit, false);
              }
  
              $this->scheduleSubjectStockUnitChangeEvent($stockUnit);
          }
      }
docs: Update event handler.
  
  @param ResourceEventInterface $event