R/globals.R

Defines functions shiny_examples_dir_update shiny_examples_dir

globals <- new.env(parent = emptyenv())

shiny_examples_dir_update <- function(examples_repo = "rstudio/shiny-examples") {
  # set the globals shiny locatino for further use
  globals$shiny_examples_loc <- download_repo(
    examples_repo,
    tempdir()
  )
  globals$shiny_examples_loc
}
shiny_examples_dir <- function(examples_repo) {
  ret <- globals$shiny_examples_loc
  if (!is.null(ret)) {
    return(ret)
  }
  return(
    shiny_examples_dir_update(examples_repo)
  )
}
rstudio/testShinyExamples documentation built on May 6, 2019, 8:30 p.m.