• Ensure that the passed subject is not nil; throw otherwise.

    Type Parameters

    • TSubject

      The type of the subject.

    Parameters

    • subject: Maybe<TSubject>

      A subject that is possibly nil.

    • OptionalerrorMessage: string

      An optional error message to throw when the subject is nil.

    Returns TSubject

    The subject, if it isn't nil.

    UnexpectedNilError When the subject is nil.