R/cache.R

Defines functions cache_call

#' Cache function call to filesystem through memoise
#'
#' @param FUN A function to cache
#'
#' @importFrom memoise memoise cache_filesystem
#' @noRd
#'
cache_call <- function(FUN) {
  db <- memoise::cache_filesystem("~/.rcache")
  res <- memoise::memoise(FUN, cache = db)

  return(res)
}
andodet/citymappR documentation built on Oct. 18, 2021, 6:11 p.m.