Global hooks system
Global hooks system
(hook! hook-name fun)
(hook! hook-name options fun)
Install a hook. Hooks are fired with undefined ordering, with each subsequent hook receiving the results of the one before it. The argument(s) passed to a hook are arbitrary, but each hook MUST return the same 'type' of data it received, so as to play nicely with other installed hooks of the same kind.
The name of a hook is similarly arbitrary---it may be a String or a Keyword or whatever you want, as long as you use it consistently.
Install a hook. Hooks are fired with undefined ordering, with each subsequent hook receiving the results of the one before it. The argument(s) passed to a hook are arbitrary, but each hook MUST return the same 'type' of data it received, so as to play nicely with other installed hooks of the same kind. The name of a hook is similarly arbitrary---it may be a String or a Keyword or whatever you want, as long as you use it consistently.
(insert-hook! hook-name fun)
DEPRECATED: use (hook!)
with a priority.
Insert a fn as the first to be called for the given hook, before any already-registered hooks. See hook!
DEPRECATED: use `(hook!)` with a priority. Insert a fn as the first to be called for the given hook, before any already-registered hooks. See hook!
(installed-hook-pairs hook-name)
Get the list of [name, installed hook fn] names for the given hook
Get the list of [name, installed hook fn] names for the given hook
(installed-hooks hook-name)
Get the list of installed hook funs for the given hook
Get the list of installed hook funs for the given hook
(trigger! hook-name arg)
Trigger a hook kind. hook-name should be a previously installed hook via (hook!), but it is not an error to fire a hook with nothing installed to it. Returns the final result returned from the last-run hook fn, or the input arg itself if no hooks are installed.
Trigger a hook kind. hook-name should be a previously installed hook via (hook!), but it is not an error to fire a hook with nothing installed to it. Returns the final result returned from the last-run hook fn, or the input arg itself if no hooks are installed.
(unhook! hook-name fun)
Uninstall a previously installed hook fn
Uninstall a previously installed hook fn
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close