react-aad icon indicating copy to clipboard operation
react-aad copied to clipboard

Use string literal type for AuthenticationState

Open jamiehaywood opened this issue 5 years ago • 0 comments
trafficstars

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 avatar Oct 08 '20 15:10 jamiehaywood