Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Isn't clear-hooks redundant? #19

Open
kindlychung opened this issue May 13, 2015 · 0 comments
Open

Isn't clear-hooks redundant? #19

kindlychung opened this issue May 13, 2015 · 0 comments

Comments

@kindlychung
Copy link

Isn't clear-hooks redundant? Eventually all hooks are cleared anyways.

(defn- clear-hook-mechanism [target-var]
  (alter-var-root target-var
                  (constantly (original target-var))))



(defn clear-hooks
  "Remove all hooks from target-var."
  [target-var]
  (when-let [hooks (hooks target-var)]
    (swap! hooks empty)
    (clear-hook-mechanism target-var)))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant