latestEventStatus function

EventStatus latestEventStatus(
  1. EventStatus status1,
  2. EventStatus status2
)

Takes two EventStatus values and returns the one with higher (better in terms of message sending) status.

Implementation

EventStatus latestEventStatus(EventStatus status1, EventStatus status2) =>
    status1.intValue > status2.intValue ? status1 : status2;