code: func (n *EvalApplyPre) Eval(ctx EvalContext) (interface{}, error) {
  	change := *n.Change
  	absAddr := n.Addr.Absolute(ctx.Path())
  
  	if change == nil {
  		panic(fmt.Sprintf("EvalApplyPre for %s called with nil Change", absAddr))
  	}
  
  	if resourceHasUserVisibleApply(n.Addr) {
  		priorState := change.Before
  		plannedNewState := change.After
  
  		err := ctx.Hook(func(h Hook) (HookAction, error) {
  			return h.PreApply(absAddr, n.Gen, change.Action, priorState, plannedNewState)
  		})
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	return nil, nil
  }
docs: // TODO: test