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 string literal type for AuthenticationState #279

Open
jamiehaywood opened this issue Oct 8, 2020 · 0 comments
Open

Use string literal type for AuthenticationState #279

jamiehaywood opened this issue Oct 8, 2020 · 0 comments

Comments

@jamiehaywood
Copy link

jamiehaywood commented Oct 8, 2020

Is your feature request related to a problem? Please describe.
Not a problem per se, but VSCode gives much nicer intellisense for string literal types over enums. It also looks cleaner when writing the code rather than having AuthenticationState.Authenticated, you have 'Authenticated' string literal.

Describe the solution you'd like
Change:

export enum AuthenticationState {
  Unauthenticated = 'Unauthenticated',
  InProgress = 'InProgress',
  Authenticated = 'Authenticated',
}

to

export type AuthenticationState = 'Unauthenticated' | 'InProgress' | 'Authenticated';

Describe alternatives you've considered
N/A

Additional context

jamiehaywood added a commit to jamiehaywood/react-aad that referenced this issue Oct 8, 2020
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

No branches or pull requests

1 participant