makeModule
makeModule.Rd
Function to make a ShinyModule
from an UI element and server function.
Details
The function allows for easy migration between bespoke shiny code and the
modular framework in DarwinShinyModules
, without having to implement an
R6
class. One caveat is, is the generated module is completely isolated.
Meaning that the module does not allow other modules to read from or write
to any defined (reactive) variables in the provided server function.
Examples
library(DarwinShinyModules)
library(shiny)
ui <- tagList(p("My UI"))
server <- function(input, output, session) {
# Do stuff
}
mod <- makeModule(ui, server)
if (interactive()) {
preview(mod)
}