Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

clear-hooks to remove all hooks from a function? #1

Closed
hugoduncan opened this Issue · 1 comment

2 participants

@hugoduncan

When recompiling hook functions, I found it useful to be able to wipe out the hooks associated with a function. remove-hook doesn't help much after a compile, as the function's identity has changed. This is the code I used, which is maybe not too efficient, but prevented duplication of the code guarded by the empty? predicate in remove-hook.

(defn clear-hooks
  "Remove hook function f from target-var."
  [target-var]
  (map
   (partial hooke/remove-hook target-var)
   @(:robert.hooke/hook (meta @target-var))))

I, for one, would find this functionality useful if included in hooke.

@technomancy
Owner

Totally reasonable. I'll get this into the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.