authReducer function
Implementation
AuthState authReducer(AuthState state, dynamic action) {
if (action is LoginAction) {
return state.copyWith(
isAuthenticated: true,
employee: action.employee,
externalApi: action.externalApi,
);
}
if (action is LogoutAction) {
return AuthState.initial();
}
return state;
}