Slide 19
Slide 19 text
© 2024 Loglass Inc.
fun validateAndCreate(userName: String, email: String): Result {
return zip(
{ UserName.validateAndCreate(userName) },
{ Email.validateAndCreate(email) },
) { validatedUserName, validatedEmail ->
User(
id = UserId.generate(),
userName = validatedUserName,
email = validatedEmail,
)
}
}