title: What's the difference between Reactive Value and Reactive Expression?
body: <p>In <a href="http://rstudio.github.io/shiny/tutorial/#reactivity-overview" rel="noreferrer">Shiny tutorial</a>, there is an example: </p>
  
  <pre><code>fib &lt;- function(n) ifelse(n&lt;3, 1, fib(n-1)+fib(n-2))
  
  shinyServer(function(input, output) {
    currentFib         &lt;- reactive({ fib(as.numeric(input$n)) })
  
    output$nthValue    &lt;- renderText({ currentFib() })
    output$nthValueInv &lt;- renderText({ 1 / currentFib() })
  })
  </code></pre>
  
  <p>I don't get how <code>reactive</code> caches the values. Does it internally do something like <code>return(function() cachedValue)</code>?
  Now I am wondering if I can do this?</p>
  
  <pre><code>fib &lt;- function(n) ifelse(n&lt;3, 1, fib(n-1)+fib(n-2))
  
  shinyServer(function(input, output) {
    currentFib         &lt;- reactiveValues({ fib(as.numeric(input$n)) })
  
    output$nthValue    &lt;- renderText({ currentFib })
    output$nthValueInv &lt;- renderText({ 1 / currentFib })
  })
  </code></pre>