I use reactiveValues in Shiny a lot as they are more flexible than just the input and output objects. Nested reactiveValues are tricky since any changes in any of the children also triggers the reactivity linked to the parents. To get around this, I tried to make two different reactiveValues objects ( not two objects in the same list, but two different lists altogether ) and it seems to be working. I'm not able to find any example of this and want to find out if it's suppose to work this way. Are there any issues that might arise because of this?
In this app, there are two reactive values objects - reac1 and reac2. Each of them are linked to a drop down, column1 and column2 respectively. Changing column1 or column2 updates the reactive values with the latest time, updates the plot, and prints the latest values in reac1 and reac2.
ui = fluidPage(
  titlePanel("Multiple reactive values"),
  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "column1", "Reac1", letters, selected = "a"),
      selectInput(inputId = "column2", "Reac2", letters, selected = "a")
    ),
    mainPanel(
      plotOutput("plot1")
    )
  )
)
server = function(input, output, session) {
  reac1 <- reactiveValues(asdasd = 0)
  reac2 <- reactiveValues(qweqwe = 0)
  # If any inputs are changed, set the redraw parameter to FALSE
  observe({
    input$column2
    reac2$qweqwe = Sys.time()
  })
observe({
    input$column1
    reac1$asdasd = Sys.time()
  })
  # Only triggered when the copies of the inputs in reac are updated
  # by the code above
  output$plot1 <- renderPlot({
      print(paste(reac1$asdasd, 'reac1'))
      print(paste(reac2$qweqwe, 'reac2'))
      hist(runif(1000))
  })
}
shinyApp(ui, server)
 
    