This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-01
Channels
- # announcements (2)
- # architecture (8)
- # babashka (21)
- # beginners (75)
- # calva (3)
- # clj-kondo (6)
- # cljdoc (6)
- # cljs-dev (10)
- # clojars (4)
- # clojure (94)
- # clojure-europe (12)
- # clojure-nl (4)
- # clojure-norway (3)
- # clojure-spec (6)
- # clojure-uk (4)
- # clojurescript (51)
- # community-development (13)
- # core-async (3)
- # css (1)
- # cursive (8)
- # datomic (7)
- # girouette (3)
- # graphql (3)
- # improve-getting-started (4)
- # integrant (2)
- # interop (5)
- # jobs (12)
- # kaocha (1)
- # lsp (24)
- # malli (4)
- # membrane (13)
- # nextjournal (9)
- # off-topic (6)
- # re-frame (9)
- # reitit (2)
- # remote-jobs (1)
- # reveal (4)
- # ring (4)
- # scittle (3)
- # shadow-cljs (4)
- # spacemacs (1)
- # testing (2)
- # vrac (1)
@drewverlee: Yes there’s a real benefit there.
It’s probably easier to understand it in the context of the competition… e.g. mount which associates components with vars/namespaces.
The important point is essentially that namespaces and vars are essentially singletons. e.g. in a running process there is really only ever one clojure.core/map
; so if your component system ties components to namespaces/vars then things are always by their nature singletons. You can’t for example just reconfigure the system to spawn two slightly different instances of the system at the same time; you would need to code it so it can do that; where as with integrant every system is a value (typically with some associated resources, e.g. sockets/ports); and therefore you can have as many of them as you want.
Sure you need to make sure it’s configured so there are no collisions on scarce resources likes port; but it’s fundamentally possible with integrant; and for your app itself not to really care.
A common use case for this; is that you can run both a dev environment (for noodling around by hand) and a test environment for repeatability in the same REPL.