insightsengineering / insightsengineering/teal

Simplify `module()` defaults

Open
#1,093 1 comment 0 reactions 0 assignees View on GitHub
core
Dominant language
R
Stars
263
Forks
59
Avg merge
5d 17h
Merged PRs (30d)
5

Description

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,
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.