PandaH.
03/20/2020, 2:27 PM// typescript
type ID = String;
function generateId(obj): ID { ...body... }
basically, how to create types like above. i came up with this, but im not sure if its the best way:
// kotlin
class ID : String()
fun generateId(obj: Obj): ID { ...body... }
thank you!diesieben07
03/20/2020, 2:33 PMString
is final
.
Check out type aliases: https://kotlinlang.org/docs/reference/type-aliases.htmlJakub Pi
03/20/2020, 2:34 PMdata class ID(val id: String)
You'll have to access the value via its id property in this casePandaH.
03/20/2020, 2:36 PMBurkhard
03/20/2020, 8:45 PM