Comment

Comment by boubiyeah

But that's the simplest union type.

You could have:

type Result = {type: 'ok', value: string} | {type: 'err', value: string}

parent boubiyeah 7 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton