auth.reducer.ts
export function authReducer(state: AuthState = initialState,
action: AuthActionsUnion) {
switch (action.type) {
case AuthActionTypes.Login:
return {
...state,
loginPending: true,
errorMessage: ''
};
case AuthActionTypes.LoginSuccess:
return {
isLoggedIn: true,
currentUser: action.payload,
loginPending: false,
errorMessage: ''
};
...
}