maybeWhen<T> method

T maybeWhen<T>({
  1. T? client()?,
  2. T? federation()?,
  3. required T orElse(),
})

Implementation

T maybeWhen<T>({
  T? Function()? client,
  T? Function()? federation,
  required T Function() orElse,
}) =>
    {
      EventFormat.client: client,
      EventFormat.federation: federation,
    }[this]
        ?.call() ??
    orElse();