Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use literal types to allow discriminated unions #45

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

sciyoshi
Copy link
Contributor

@sciyoshi sciyoshi commented Jun 2, 2019

See https://basarat.gitbooks.io/typescript/docs/types/discriminated-unions.html - this will allow TypeScript to narrow types when checking equality on the type field.

@Booligoosh
Copy link

@jackbearheart Would be awesome if you could merge this!

@jackbearheart jackbearheart merged commit df10379 into jackbearheart:master Sep 16, 2020
@sciyoshi sciyoshi deleted the patch-2 branch September 16, 2020 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants