mount

2017-03-28T09:53:04.837736Z

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.

tolitius 2017-03-28T11:44:03.829559Z

@kurt-o-sys sure

tolitius 2017-03-28T11:44:26.832838Z

=> (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"}})

2017-03-28T11:45:13.839639Z

oh, cool! Much better than what I had in mind. Perfect. Thx.

tolitius 2017-03-28T11:45:19.840668Z

there is also:

=> (mount/running-states)
#{"#'app.www/nyse-app" "#'app.example/nrepl" "#'app.conf/config" "#'app.db/conn"}

tolitius 2017-03-28T11:45:28.841954Z

sure, welcome

tolitius 2017-03-28T11:46:17.849128Z

(the first one only works in .clj (i.e. not .cljs) at the moment)

2017-03-28T11:47:17.857995Z

it is for .clj, so well, wicked-awesome 🙂

arnout 2017-03-28T14:10:21.692454Z

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 refreshing the project, without restarting all the states when only a few might be reloaded.

arnout 2017-03-28T14:10:47.700246Z

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