Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Types and CoProducts in scala

sealed trait Request
case class CreateUser(name: String)                   extends Request
case class ReadUserInfo(userId: Int)                  extends Request
case class UpdateUserInfo(userId: Int, name: String)  extends Request
case class DeleteUser(userId: Int)                    extends Request
Source by koff.io #
 
PREVIOUS NEXT
Tagged: #Types #CoProducts #scala
ADD COMMENT
Topic
Name
2+3 =