docs: function (state, action) {
      const newState = {
        lastAction: CHANGE_MODEL
      }
  
      // Replace $ref's with definitions so consumers don't have to parse references
      newState.unnormalizedModel = getDereferencedModelSchema(action.model)
  
      // If we have an unnormalized view then we need to update our model to make
      // sure any model extensions defined in the view get applied
      if (state.unnormalizedView) {
        const normalized = normalizeModelAndView({
          model: newState.unnormalizedModel,
          view: state.unnormalizedView
        })
        newState.baseModel = normalized.model
        newState.baseView = normalized.view
        newState.view = evaluateViewConditions(newState.baseView, state.value)
      } else {
        newState.baseModel = newState.unnormalizedModel
      }
  
      // Evaluate and remove model conditions so consumers don't have to parse conditions
      newState.model = evaluateConditions(newState.baseModel, state.value, undefined, state.value)
  
      return _.defaults(newState, state)
    }