I want Shiny to wait a little bit for the user to input their group size (without using a button). This is a simpler version of my code, but in my actual code, I have more user inputs (so I only want Shiny to wait 2 seconds for this input only). I've been trying to figure out how I would use debounce
for this code, but I'm not sure.
library(shiny)
shinyApp(ui <- fluidPage(sidebarPanel(
"",
numericInput("groupSize", label =
"How many people will be with you?", value = ""),
textOutput("output")
)) ,
server <- function(input, output, session) {
getNumber <- reactive({
req(input$groupSize>=0)
groupSize <- input$groupSize
})
output$output <- renderText({
getNumber()
})
})
This works with
debounce
:groupsize
debounce
to create a new functiongroupsize_d