export function reducer()

in src/app/teller/store/authentication.reducer.ts [36:70]


export function reducer(state = initialState, action: teller.Actions): State {
  switch (action.type) {

    case teller.UNLOCK_DRAWER: {
      return Object.assign({}, state, {
        loading: true,
        authenticated: false
      });
    }

    case teller.UNLOCK_DRAWER_SUCCESS: {
      const teller: Teller = action.payload;
      return Object.assign({}, state, {
        loading: false,
        teller,
        authenticated: true
      });
    }

    case teller.UNLOCK_DRAWER_FAIL: {
      const error = action.payload;
      return Object.assign({}, state, {
        loading: false,
        error
      });
    }

    case teller.LOCK_DRAWER_SUCCESS: {
      return initialState;
    }

    default:
      return state;
  }
}