2 ms·
Or better, use Elm (or something similar) and tagged unions. That way you get type-checking and exhaustive-checking of your message types. You still have a big
by masklinn 11y ago
Or better, use Elm (or something similar) and tagged unions. That way you get type-checking and exhaustive-checking of your message types. You still have a big match (~switch/case) but now the compiler yells at you if you've forgotten to handle a message tag or if you're not unpacking the right types from it.