teal icon indicating copy to clipboard operation
teal copied to clipboard

Simplify `module()` defaults

Open pawelru opened this issue 6 months ago • 1 comments

This is what I'm seeing in manual:

module(
  label = "module",
  server = function(id, ...) {
     moduleServer(id, function(input, output, session) {
 
       })
 },
  ui = function(id, ...) {
     tags$p(paste0("This module has no UI (id: ", id, " )"))

    },
  filters,
  datanames = "all",
  server_args = NULL,
  ui_args = NULL
)

modules(..., label = "root")

# S3 method for teal_module
format(x, indent = 0, ...)

# S3 method for teal_module
print(x, ...)

# S3 method for teal_modules
format(x, indent = 0, ...)

# S3 method for teal_modules
print(x, ...)

I think we can simplify the default ui and server arguments.

A proposal:

server = function(id, ...) {
     moduleServer(id, function(input, output, session) NULL)
 },
ui = function(id, ...) NULL,

I would even test it with the following:

server = function(id, ...) NULL,
ui = function(id, ...) NULL,

pawelru avatar Feb 07 '24 11:02 pawelru