Skip to content

Commit

Permalink
chore: change argument name in line with observeEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Oct 11, 2024
1 parent 5a60dfe commit 126c547
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 5 additions & 7 deletions R/module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -379,23 +379,21 @@ srv_teal_module.teal_module <- function(id,
#'
#' Function postpones `handlerExpr` to the moment when `eventExpr` (condition) returns `TRUE`,
#' otherwise nothing happens.
#' @param condExpr logical expression determining moment when `handlerExpr` should be evaluated.
#' @param eventExpr A (quoted or unquoted) logical expression that represents the event;
#' this can be a simple reactive value like input$click, a call to a reactive expression
#' like dataset(), or even a complex expression inside curly braces.
#' @param ... additional arguments passed to `observeEvent` with the exception of `eventExpr` that is not allowed.
#' @inheritParams shiny::observeEvent
#'
#' @return An observer.
#'
#' @keywords internal
call_once_when <- function(condExpr, # nolint: object_name.
call_once_when <- function(eventExpr, # nolint: object_name.
handlerExpr, # nolint: object_name.
event.env = parent.frame(), # nolint: object_name.
handler.env = parent.frame(), # nolint: object_name.
...) {
if ("eventExpr" %in% names(rlang::list2(...))) {
stop("eventExpr is not allowed in call_once_when.")
}

event_quo <- rlang::new_quosure(substitute(condExpr), env = event.env)
event_quo <- rlang::new_quosure(substitute(eventExpr), env = event.env)
handler_quo <- rlang::new_quosure(substitute(handlerExpr), env = handler.env)

# When `condExpr` is TRUE, then `handlerExpr` is evaluated once.
Expand Down
6 changes: 4 additions & 2 deletions man/call_once_when.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 126c547

Please sign in to comment.