code: function reducer() {
      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var action = arguments[1];
  
      // add initial state
      if (action.type === (0, _.generateType)(_.types.add, (0, _get2.default)(action, 'payload.name'))) {
          return _extends({}, state, _defineProperty({}, action.payload.name, action.payload.state));
      }
  
      // delete state
      if (action.type === (0, _.generateType)(_.types.delete, (0, _get2.default)(action, 'payload.name'))) {
          var tempState = _extends({}, state);
          delete tempState[action.payload.name];
          return tempState;
      }
  
      // reset to initial state
      if (action.type === (0, _.generateType)(_.types.reset, (0, _get2.default)(action, 'payload.name'))) {
          return _extends({}, state, _defineProperty({}, action.payload.name, action.payload.state));
      }
  
      // shallow merge for state updates
      if (action.type === (0, _.generateType)(_.types.set, (0, _get2.default)(action, 'payload.name'))) {
          return (0, _immutabilityHelper2.default)(state,
          // if store not created with combinedReducers, assume state is top-level
          state[action.payload.name] ? _defineProperty({}, action.payload.name, { $merge: action.payload.state }) : { $merge: action.payload.state });
      }
  
      return state;
  }
docs: this reducer handles all state changes for the uiState slice