When to reach for this pattern
Use it when your API starts enum-like, but one or more variants need payload. This comes up in job scheduling, retry policies, caching strategies, connection modes, and UI state transitions.
If one variant is just a label and another variant needs arguments, you are usually no longer designing a plain enum. The optimize setting in @bun-and-butter/sqlite is one concrete example: one mode is constant, one mode is parameterized, and both still belong to the same small conceptual family. That is where discriminated unions shine.