Skip to content

Commit

Permalink
Merge 6f08b49 into e03bf26
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeyakirar authored Mar 26, 2024
2 parents e03bf26 + 6f08b49 commit 767a7c2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions R/TealAppDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,27 @@ TealAppDriver <- R6::R6Class( # nolint: object_name.
#' @return Nothing. Opens the underlying teal app in the browser.
open_url = function() {
browseURL(self$get_url())
},
#' @description
#' Waits until a specified input, output, or export value.
#' This function serves as a wrapper around the `wait_for_value` method,
#' providing a more flexible interface for waiting on different types of values within the active module namespace.
#' @param ... Dynamic parameters allowing the specification of either an `input`, `output`, or `export` parameter with,
#' additional value to passed in `wait_for_value`
wait_for_active_module_value = function(...) {
dots <- list(...)
param_types <- intersect(names(dots), c("input", "output", "export"))
checkmate::assert(
checkmate::assert_choice(parm_type, c("input", "output", "export")),
checkmate::assert_character(dots[[param_type]], len = 1, min.chars = 1),
combine = "and"
)


modified_id <- sprintf("%s-%s", self$active_module_ns(), dots[[param_type]])
dots <- dots[!names(dots) %in% param_type]

do.call(what = self$wait_for_value, args = c(list(param_type = modified_id, timeout = private$load_timeout), dots))
}
),
# private members ----
Expand Down
21 changes: 21 additions & 0 deletions man/TealAppDriver.Rd

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

0 comments on commit 767a7c2

Please sign in to comment.