If we look at the implementation of the shinyServer function, it's not too hard to see that it just inserts the passed function into what I presume is the global environment. However, I haven't seen the global environment referred to as ".globals" before and only as ".GlobalEnv" or "globalenv()".
library(shiny)
shinyServer
#> function (func)
#> {
#> .globals$server <- list(func)
#> invisible(func)
#> }
#> <environment: namespace:shiny>
I would like to be able to retrieve the function implicitly passed to the shinyServer function from wherever it is being assigned to. I've been looking in the global environment, but I don't see a server
object there after using the shinyServer function. Where is .globals
and how do I access it and its contents including .globals$server
?