Does mount have a kind of ls
of all mounted states? Something that could look like:
(mount/ls)
{#'app.config/config #'app.nyse/conn
#'app.sms/send-sms send-sms
...}
so one can check which states are loaded with which values.@kurt-o-sys sure
=> (require '[mount.tools.graph :as g])
=> (g/states-with-deps)
({:name "#'app.conf/config", :order 1, :status #{:started}, :deps #{}}
{:name "#'app.db/conn",
:order 2,
:status #{:started},
:deps #{"#'app.conf/config"}}
{:name "#'app.www/nyse-app",
:order 3,
:status #{:started},
:deps #{"#'app.conf/config" "#'app.db/conn"}}
{:name "#'app.example/nrepl",
:order 4,
:status #{:started},
:deps #{"#'app.conf/config"}})
oh, cool! Much better than what I had in mind. Perfect. Thx.
there is also:
=> (mount/running-states)
#{"#'app.www/nyse-app" "#'app.example/nrepl" "#'app.conf/config" "#'app.db/conn"}
sure, welcome
(the first one only works in .clj
(i.e. not .cljs
) at the moment)
it is for .clj
, so well, wicked-awesome 🙂
Unfortunately I can't remember who it was, but he/she asked me some weeks ago how mount-lite 2.0
can play nice with the tools.namespace
contrib library. The question was about refresh
ing the project, without restarting all the states when only a few might be reloaded.
Today I added a new extension to mount-lite 2.0
that helps with this: https://github.com/aroemers/mount-lite/blob/2.x/src/mount/extensions/refresh.clj