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

docs: use angle bracket syntax for enum type def #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

docs: use angle bracket syntax for enum type def #32

wants to merge 1 commit into from

Conversation

mattrothenberg
Copy link

Howdy! I think I found a small typo in the docs re: exporting enum types. Let me know if I'm off base.

When exporting an Enum type, it's necessary to use the angle brackets (instead of parentheses).

 export const AnswerResponse = Enum('No', 'Yes')
 export type AnswerResponse = Enum<typeof AnswerResponse>
// ^^ if we use parentheses again here, we'll get a Typescript compilation error.

If there is a linked issue, mention it here.

Requirements

Rationale

Why is this PR necessary?

The docs aren't accurate and might confuse people (like me).

When exporting an `Enum` type, it's necessary to use the angle brackets (instead of parentheses).
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.

2 participants