This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-29
Channels
- # admin-announcements (1)
- # aws (10)
- # beginners (76)
- # boot (53)
- # braid-chat (1)
- # cider (80)
- # cljs-edn (3)
- # clojure (65)
- # clojure-belgium (2)
- # clojure-gamedev (2)
- # clojure-nl (3)
- # clojure-poland (1)
- # clojure-russia (39)
- # clojure-uk (14)
- # clojurescript (91)
- # cursive (62)
- # datascript (1)
- # datomic (9)
- # dirac (34)
- # emacs (25)
- # error-message-catalog (8)
- # events (1)
- # hoplon (88)
- # instaparse (1)
- # jobs (2)
- # jobs-discuss (6)
- # lein-figwheel (7)
- # luminus (43)
- # mount (5)
- # off-topic (7)
- # om (28)
- # onyx (61)
- # planck (4)
- # re-frame (27)
- # reagent (3)
- # remote-jobs (2)
- # spacemacs (3)
- # untangled (136)
@ido: it would be good to see a simple example of what you are trying to achieve. most of the time non obvious things are non obvious for a reason and there is just a different way / angle to solve the problem.
explicit deps is something we were thinking about: https://github.com/tolitius/mount/issues/48 but my feeling is that a permutation of states: https://github.com/tolitius/mount#composing-states, or a lazy loaded app (in cljc
mode): https://github.com/tolitius/mount/blob/master/doc/clojurescript.md#clojure-and-clojurescript-mode, or another sequence of how the app is started, will solve it.
I could be wrong of course, but that would be only clear when you provide a simple example of what it is you are trying to do, and why
@ido so you could potentially do something like:
(ns common.kafka ...)
(defstate consumer :start (start-with-topic (topic-from (mount/args))))
(ns common.db ...)
(defstate db :start (connect-db (db-url-from (mount/args))))
(ns service1 (:require [common.kafka :refer (consumer)] [common.db :refer (db)]))
(defn do-something [] (query db) (process consumer))
basically you don't pass the states around, but rather initialize with an appropriate configuration. As an alternative you could hav e a common.config
ns with a dynamic *config*
var which you would bind like:
(binding [common.config/*config* (service1-config)]
(mount/start))
I don't think passing Mount states around is supported by the design, but I might be proved wrong!