powered by
Hooks class
List of hooks
(character) Hook name
Args passed when invoking a hook
Placement, one of "start" or "end"
A function
Whether to prepend or add to the end of the string. Default: FALSE
FALSE
Helps define new hooks, hold hooks, and accessors to get and use hooks. Methods
invoke_hook(hook_type, args)
Invoke a hook, i.e., call a hook.
clear_hooks()
Remove all hooks.
define_hook(hook_type, fun, prepend = FALSE)
Define a hook.
Private Methods
make_hook(x, plac, fun)
Make a hook.
# NOT RUN { (x <- Hooks$new()) x$hooks x$define_hook(hook_type = "foo", fun = function(x) x ^ 2) x$hooks$foo(4) x$clear_hooks() x$hooks # }
Run the code above in your browser using DataLab