title: How to use debounce with reactiveValues in shiny
body: <p>I understand that I can use debounce with reactive() like this, and this is the sort of behaviour I need, but I want to use reactiveValues() instead.</p>
  
  <pre><code>ui &lt;- fluidPage(
        textInput(inputId = "text",
                  label = "To see how quickly..."),
        textOutput(outputId = "text")
  )
  
  server &lt;- function(input, output, session) {
        text_input &lt;- reactive({
              input$text
        })
  
        debounce(text_input, 2000)
  
        output$text &lt;- renderText({
              text_input()
        })
  }
  shinyApp(ui, server)
  }
  </code></pre>
  
  <p>But I would prefer to use reactiveValues() rather than reactive().
  Is there any way to use debounce with reactiveValues()?
  This does not work:</p>
  
  <pre><code>ui &lt;- fluidPage(
    textInput(inputId = "text",
              label = "To see how quickly..."),
    textOutput(outputId = "text")
  )
  
  server &lt;- function(input, output, session) {
  
    values &lt;- reactiveValues()
  
  
    observe({
      values$text= function(x)input$text
  
    values$t &lt;-
      debounce(values$text(),2000)
  
    })
  
  
    output$text &lt;- renderText({
      values$t()
    })
  }
  shinyApp(ui, server)
  </code></pre>
  
  <p>I get an error <code>Warning: Error in r: could not find function "r"</code>, I guess because <code>values</code> is not a reactive expression?</p>