Append multiple reactive output of a shiny module to an existing reactiveValue object in the app


I would like to add multiple reactive output object of a shiny module to a reactiveValue list in the main app. I have found a similar solution HERE.

They pass the output reactive values from the module to the app as a named list like this (in the module):

return(list(var1 = reactive({input$btn}), 
            var2 = reactive({input$text})))

And they store it for further processing in the main app in the following way (in the app):

vars <- callModule(module, "test")

In my case, I would like to add the module output values to an already existing reactive value. So I cannot use the <- assing function. Other ways to append list levels that were mentioned HERE, did not work for me in this context. I tried

vars <- reactiveValue()

vars$data <- reactive({input$data})

append(callModule(module, "test), vars)

But the passed reactive values did not seem to work outside of the module.

Do you have any tips to solve this problem in an elegant way?


Does c() not work for reactive values?

vars <- reactiveValue()

vars$data <- reactive({input$data})

vars = c(callModule(module, "test"), vars))


I checked again and it worked. I think the problem was that I wanted to pass a reactive value to the module that was saved in the vars object, like the following:

vars <- reactiveValues()

vars$trigger <- reactive({input$actionbutton})

vars <- c(callModule(module, "test", trigger = vars$trigger), vars))

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.