Skip to contents

[Experimental]

Exported to be able to use methods not to be used directly by module-developers or app-users. Primarily used to modify the output object of module.

Usage

after(x, server = function(input, output, session, data) data, ...)

Arguments

x

(teal_module or teal_modules).

server

(function(input, output, session, data, ...)) function to receive output data from tm$server. Must return data

...

Additional arguments passed to the server wrapper function by matching their formal names.

Value

A teal_module or teal_modules object with a wrapped server.

Examples

library("teal.reporter")
#> 
#> Attaching package: ‘teal.reporter’
#> The following object is masked from ‘package:testthat’:
#> 
#>     Reporter
hide_code <- function(input, output, session, data) {
  teal_card(data) <- Filter(function(x) !inherits(x, "code_chunk"), teal_card(data))
  data
}
app <- init(
  data = teal_data(IRIS = iris, MTCARS = mtcars),
  modules = example_module() |>
    after(server = hide_code)
)

if (interactive()) {
  runApp(app)
}