when<T> method

T when<T>({
  1. required T guest(),
  2. required T user(),
})

Implementation

T when<T>({
  required T Function() guest,
  required T Function() user,
}) =>
    {
      AccountKind.guest: guest,
      AccountKind.user: user,
    }[this]!();