diff --git a/README.md b/README.md index 94ccfda..7f8c8da 100644 --- a/README.md +++ b/README.md @@ -581,7 +581,7 @@ Since mount is a _library_ it should _not_ bring any dependencies unless its fun > But I still these logging statements in the examples. -The way this is done is via an excellent [robert hooke](https://github.com/technomancy/robert-hooke/). Example applications live in `test`, so does the [utility](https://github.com/tolitius/mount/blob/75d7cdc610ce38623d4d3aea1da3170d1c9a3b4b/test/app/utils/logging.clj#L44) that adds logging to all the mount's lifecycle functions on start in [dev.clj](https://github.com/tolitius/mount/blob/75d7cdc610ce38623d4d3aea1da3170d1c9a3b4b/dev/dev.clj#L21). +The way this is done is via an excellent [robert hooke](https://github.com/technomancy/robert-hooke/). Example applications live in `test`, so does the [utility](test/clj/tapp/utils/logging.clj#L42) that adds logging to all the mount's lifecycle functions on start in [dev.clj](https://github.com/tolitius/mount/blob/75d7cdc610ce38623d4d3aea1da3170d1c9a3b4b/dev/dev.clj#L21). ## Clojure Version diff --git a/build.boot b/build.boot index 9a973eb..fa9db02 100644 --- a/build.boot +++ b/build.boot @@ -1,4 +1,4 @@ -(def +version+ "0.1.10") +(def +version+ "0.1.11-SNAPSHOT") (set-env! :source-paths #{"src"} diff --git a/src/mount/core.cljc b/src/mount/core.cljc index 1917961..4973067 100644 --- a/src/mount/core.cljc +++ b/src/mount/core.cljc @@ -312,16 +312,18 @@ (add-watcher [_ ks state] (doseq [k ks] - (swap! watchers update k #(conj % state)))) + (swap! watchers update k (fn [v] + (-> (conj v state) vec))))) - (on-change [_ k] - (let [states (@watchers k)] - (apply stop states) - (apply start states)))) + (on-change [_ ks] + (doseq [k ks] + (when-let [states (seq (@watchers k))] + (apply stop states) + (apply start states))))) -(defn restart-listner +(defn restart-listener ([] - (restart-listner {})) + (restart-listener {})) ([watchers] (RestartListener. (atom watchers))))