Learn R Programming

teal (version 1.1.0)

after: Executes modifications to the result of a module

Description

[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, ...)

Value

A teal_module or teal_modules object with a wrapped server.

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.

See Also

disable_src(), disable_report()

Examples

Run this code
library("teal.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)
}

Run the code above in your browser using DataLab