DEV Community

Discussion on: Status instead of isLoading boolean?

Collapse
 
adarshaacharya profile image
Aadarsha Acharya 🚀

Hi, how would you implement enum over here?
I'm definining my state types as :

export interface AuthState {
  status: 'idle' | 'pending' | 'resolved' | 'rejected';
  isAuthenticated: boolean;
  error: string;
  user: User;
}
Enter fullscreen mode Exit fullscreen mode

and giving me type safety. Are you talking about making StatusEnum?