All files / reducers user.ts

87.5% Statements 7/8
66.67% Branches 4/6
100% Functions 1/1
85.71% Lines 6/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161x       2x 2x 1x     1x 1x          
import { ActionNames } from '../actions';
import { LoginActions } from '../actions/login';
import { UserInfo } from '../userProfile';
 
export function user(Istate: UserInfo = null, action: LoginActions): UserInfo {
  if (action.type === ActionNames.login.logOut) {
    return null;
  }
 
  Eif (action.type === ActionNames.login.getUserResult) {
    return action.user;
  }
 
  return state;
}