Skip to content

Commit c283343

Browse files
authored
fix srv_decorate_teal_data expression check
Signed-off-by: Marcin <[email protected]>
1 parent ad5299c commit c283343

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

R/utils.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ assert_single_selection <- function(x,
290290
#' @param expr (`reactive`) with expression to evaluate on the output of the
291291
#' decoration. It must be compatible with `code` argument of [teal.code::eval_code()].
292292
#' Default is `NULL` which won't evaluate any appending code.
293+
#' @param keep_output (`character`) optional, names of the outputs to keep.
294+
#' Default is `NULL` which won't keep any outputs.
293295
#' @details
294296
#' `srv_decorate_teal_data` is a wrapper around `srv_transform_teal_data` that
295297
#' allows to decorate the data with additional expressions.
@@ -301,12 +303,14 @@ srv_decorate_teal_data <- function(id, data, decorators, expr, keep_output = NUL
301303
checkmate::assert_class(data, classes = "reactive")
302304
checkmate::assert_list(decorators, "teal_transform_module")
303305

306+
no_expr <- missing(expr)
307+
304308
moduleServer(id, function(input, output, session) {
305309
decorated_output <- srv_transform_teal_data("inner", data = data, transformators = decorators)
306310

307311
reactive({
308312
req(data(), decorated_output())
309-
if (missing(expr)) {
313+
if (no_expr) {
310314
decorated_output()
311315
} else {
312316
req(expr())

0 commit comments

Comments
 (0)