gargoyle icon indicating copy to clipboard operation
gargoyle copied to clipboard

fix: pass argument session down to watch()

Open ilyaZar opened this issue 1 year ago • 0 comments

Fix #17

Could not to get reprexes working with these shiny reactive console things...

so here is the output from my console copy pasted:

library(shiny)
library(gargoyle)
 
shiny::reactiveConsole(TRUE)
s <- shiny::MockShinySession$new()
 
init("pif", session = s)
#> [[1]]
#> reactiveVal: [1] "0" 

test_for_on_function <- on(
     "pif",
     {
         cat("TEST fails")
     },
     session = s
)
test_for_on_function$.func()
#> TEST fails
shiny::reactiveConsole(FALSE)

The message "TEST fails" prints correctly compared to the issue where the error is produced.

ilyaZar avatar Jul 04 '23 11:07 ilyaZar