R/zzz.R

Defines functions .onUnload .onAttach .onLoad

.onLoad <- function(...) {
  has_moved <<- memoise::memoise(has_moved)
}

.onAttach <- function(...) {
  conflicts_register()
}

# This should really be done on .onDetach(), but because it's called inside of
# detach() it messes up the computation of `pos` inside of `detach()` and it
# detaches the wrong environment
.onUnload <- function(...) {
  conflicts_reset()
}
r-lib/conflicted documentation built on Feb. 27, 2024, 8:58 p.m.