🌱 Tagged Unions

Normal unions are something like:

type loading = 'not asked' | 'loading' | 'loaded'

A tagged union can use interfaces with extra information on the type.

interface NotAsked {
  kind: 'notAsked'
  otherInfo: 'something'
}

interface Loading {
  kind: 'loading'
}

type Loading = NotAsked | Loading
Made by Brandon . If you find this project useful you can donate.