-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
library(shiny)
library(gargoyle)
options("gargoyle.talkative" = TRUE)
ui <- function(request){
tagList(
h4('Go'),
actionButton("y", "y"),
actionButton("z", "z"),
h4('Output of z$v'),
tableOutput("evt")
)
}
server <- function(input, output, session){
# Initiating the flags
init( "airquality", "iris", "renderiris", "a2")
# Creating a new env to store values, instead of
# a reactive structure
z <- new.env()
observeEvent( input$y , {
z$v <- mtcars
# Triggering the flag
trigger("airquality")
})
observeEvent( input$y , {
#z$v <- mtcars
# Triggering the flag
trigger("a2")
})
on("airquality", {
# Triggering the flag
z$v <- airquality
trigger("iris")
})
on("iris", {
# Triggering the flag
z$v <- iris
trigger("renderiris")
})
## need to use both 'iris' & 'a2'
on({"iris", "a2"},{
print("observed!")
})
output$evt <- renderTable({
# This part will only render when the renderiris
# flag is triggered
watch("renderiris")
head(z$v)
})
}
shinyApp(ui, server)Note: It doesn't work!
Metadata
Metadata
Assignees
Labels
No labels