I like the tricks :) – Kasia
Let the compiler keep in sync your types, so you don't have to remember it yourself.
type Admin = { _kind: 'admin' } type Member = { _kind: 'member' } type Visitor = { _kind: 'visitor' } type Roles = 'admin' | 'member' // ⛔️ Forgot 'visitor'
type User = Admin | Member | Visitor type Roles = User['_kind'] // ^? type Roles = 'admin' | 'member' | 'visitor'
Crafted with 💛 by Riccardo