mount

mike_ananev 2017-07-17T10:02:58.888756Z

Hi! Is there any way to run state for whole namespace? I have several states in one namespace "helloworld". I would like to point out only name of namespace to run all states in it instead of enumaration every defstate

arnout 2017-07-17T12:18:02.253828Z

No, but it could easily be added/programmed by yourself.

dm3 2017-07-17T14:36:14.421618Z

Using some internals

(defn states-in-ns [ns-sym]
    (let [all (set (map :var (vals @@#'mount.core/meta-state)))]
       (filter all (vals (ns-publics ns-sym)))))

dm3 2017-07-17T14:36:46.442050Z

(apply mount.core/start (states-in-ns 'my.ns))

dm3 2017-07-17T14:38:32.509934Z

there’s actually mount.core/find-all-states that you can use instead of accessing the private meta-state

mike_ananev 2017-07-17T16:40:29.039501Z

@dm3 thanks, I'll try it.