mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-08 05:35:07 -05:00
Without this change, async handlers won't return any
value for getDefaultReactiveDomain().
library(shiny)
library(promises)
ui <- fluidPage(
p("This app tests if async handlers have reactive domains. You'll get a yes/no answer below."),
h3(
"Does it work?",
textOutput("answer", inline = TRUE)
)
)
server <- function(input, output, session) {
output$answer <- renderText({
promise_resolve(TRUE) %...>% {
if (!is.null(getDefaultReactiveDomain()))
"Yes!"
else
"No :("
}
})
}
shinyApp(ui, server)