title: How to conditionally halt evaluation of child reactive expressions in R Shiny?
body: <p>Consider the following minimal working example:</p>
  
  <pre><code>library(shiny)
  runApp(list(
      ui = basicPage(
          actionButton("button", "click"),
          textOutput("text"),
          textOutput("valid")
      ),
      server = function(input, output, session) {
          parent &lt;- reactive({
              2*input$button
          })
          child1 &lt;- reactive({
              Sys.sleep(1)  # expensive function
              parent() + 1
          })
          child2 &lt;- reactive({
              Sys.sleep(1)  # expensive function
              parent() + 2
          })
          child3 &lt;- reactive({
              Sys.sleep(1)  # expensive function
              parent() + 3
          })
  
          output$text &lt;- renderText(
              paste(
                  "The meaning of life (for even input only):",
                  child1() * child2() * child3()
              )
          )
          output$valid &lt;- renderText(
              ifelse(
                  input$button %% 2 == 0,
                  "Valid - even input!",
                  "Invalid - odd input! I don't want anything to have been re-rendered!"
              )
          )
      }
  ))
  </code></pre>
  
  <p><strong>If the user specifies an invalid input</strong> (i.e. <code>input$button</code> is odd), <strong>I don't want the page to be re-rendered</strong>. In particular, child reactive expressions could contain expensive functions which I don't want to execute if the inputs are invalid.</p>
  
  <p>Also, I might have hundreds of child expressions -- I really don't want to have to put input validation code in each one.</p>
  
  <p>What can be done?</p>