The following program does not show reactivity in the Posit Cloud but does work correctly in my own R Studio Workbench account. This would seem to suggest that others might also see this problem:
This is a Shiny web application. You can run the application by clicking
the 'Run App' button above.
Find out more about building applications with Shiny here:
http://shiny.rstudio.com/
library(shiny)
ui <- fluidPage(
titlePanel("observeEvent Example"),
actionButton("clickButton", "Click Me"),
verbatimTextOutput("messageOutput")
)
Define server logic required to draw a histogram
server <- function(input, output) {
clickCount <- reactiveVal(0)
observeEvent(input$clickButton, {
newCount <- clickCount() + 1
clickCount(newCount)
message <- paste("Button clicked", newCount, "times")
output$messageOutput <- renderText(message)
})
}
shinyApp(ui, server)