Q:

I don't understand how debounce works

From the example below, I would expect the display of user input to only update every 2s (2000ms). But it's not, it's updating just as fast as when I don't include a debounce statement.
if (interactive()) {
      options(device.ask.default = FALSE)

ui <- fluidPage(
      textInput(inputId = "text",
                label = "To see how quickly..."),
      textOutput(outputId = "text")
)

server <- function(input, output, session) {
      text_input <- reactive({
            input$text
      })

      debounce(text_input, 2000)

      output$text <- renderText({
            text_input()
      })
}
shinyApp(ui, server)
}

A:

You have to assign the result of the debounce() call and use that in your output:
server <- function(input, output, session) {
    text_input <- reactive({
        input$text
    })

    text_d <- debounce(text_input, 2000)

    output$text <- renderText({
        text_d()
    })
}

