Skip to content

Commit

Permalink
Remove generic overwriting hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Nov 27, 2019
1 parent f241fd3 commit 36b94e7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions R/attach.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ overwrite_s3_generic <- function(pkg, generic){
}

# Always register hook in case package is later unloaded & reloaded
setHook(
packageEvent(pkg, "onLoad"),
function(...) {
pkg_env <- asNamespace("forecast")
unlockBinding(generic, pkg_env)
assign(generic, get(generic, asNamespace(pkg)), envir = pkg_env)
lockBinding(generic, pkg_env)
}
)
# setHook(
# packageEvent(pkg, "onLoad"),
# function(...) {
# pkg_env <- asNamespace("forecast")
# unlockBinding(generic, pkg_env)
# assign(generic, get(generic, asNamespace(pkg)), envir = pkg_env)
# lockBinding(generic, pkg_env)
# }
# )
}

#' @importFrom utils methods
Expand Down

0 comments on commit 36b94e7

Please sign in to comment.