Hi, I need to set NULL to reactive when a button is clicked. In my example below 'data' (as module parameter) is passed as reactive from other module. Now, I want to click button and set NULL to reactiveExpr . The way I'm doing it here is not working. I don't need set NULL to reactive base on any condition, just by clicking the button.
mod_ui <- function(id){
ns <- NS(id)
actionButton(ns("btn"), "Click me")
}
mod_server <- function(id, data){
moduleServer( id, function(input, output, session) {
ns <- NS(id)
reactiveExpr <- reactive(data())
observeEvent(input$btn, {
reactiveExpr(NULL)
})
# some more code...
How can I do this?