title: Advantages of reactive vs. observe vs. observeEvent
body: <p>I've reading everything I can about shiny reactive programming.  I'm a bit confused.  The following all work but what is the preferred method and why?  Obviously the example below is simple but will I run into trouble when creating a larger application with any of the methods? </p>
  
  <p>I've been tending to gravitate towards the style in server code #1.  Reason being, is that I'm able to break up the if statements.  To me this seems much more readable.  Again, the simple examples below aren't terribly complex but you can easily imagine how server code 2 and server code 3 could get very confusing with lots of nested if / if else statements.</p>
  
  <p><strong>UI Code</strong></p>
  
  <pre><code>library(shiny)
  
  ui &lt;- fluidPage(
    selectInput(inputId = 'choice',
                label = 'Choice',
                choice = c('Hello','Goodbye'),
                selected = c('Hello')
    ),
  
    textOutput('result')
  
  )
  </code></pre>
  
  <p><strong>Server Code 1</strong></p>
  
  <pre><code>server &lt;- function(input,output,session)({
  
    text &lt;- reactiveValues()
  
    observe({
      if (input$choice == 'Hello') {
        text$result &lt;- 'Hi there'
        }
      })
  
    observe({
      if (input$choice == 'Goodbye') {
        text$result &lt;- 'See you later'
        }
      })
  
    output$result &lt;- renderText({
      text$result
    })
  
  })
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p><strong>Server Code 2</strong></p>
  
  <pre><code>server &lt;- function(input,output,session)({
  
    getStatus &lt;- reactive({
  
      if (input$choice == 'Hello') {
        'Hi there'
      } else if (input$choice == 'Goodbye'){
        'See you later'
      }
    })
  
    output$result &lt;- renderText({
      getStatus()
    })
  
  })
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p><strong>Server Code 3</strong></p>
  
  <pre><code>server &lt;- function(input,output,session)({
  
    text &lt;- reactiveValues()
  
    observeEvent(input$choice,{
      if (input$choice == 'Hello') {
        text$result &lt;- 'Hi there'
      } else if (input$choice == 'Goodbye') {
        text$result &lt;- 'See you later'
      }
    })
  
    output$result &lt;- renderText({
      text$result
    })
  
  })
  
  shinyApp(ui = ui, server = server)
  </code></pre>