R/call_chunk_reactive.R

#' @description
#' Extracting the contents out of a reactive object and creating a set of calls that can evaluate the call
#' in a local environment when run outside of Shiny, preventing unnecessary variables
#'
#' @noRd
S7::method(repro_call_chunk, class_call_reactive) <- function(x, repro_code = Repro(), env = rlang::caller_env()) {
  repro_call <- repro_chunk(env[[rlang::call_name(x)]])
  repro_code@prerequisites <- repro_call@prerequisites
  repro_code@packages <- repro_call@packages

  eval_call <- assign_reactive_call(x, repro_call)
  repro_code@code <- eval_call

  repro_code
}

Try the shinyreprex package in your browser

Any scripts or data that you put into this service are public.

shinyreprex documentation built on April 27, 2026, 9:10 a.m.