This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-24
Channels
- # announcements (1)
- # aws (2)
- # beginners (147)
- # boot (19)
- # cider (57)
- # clara (52)
- # cljdoc (18)
- # cljs-dev (14)
- # cljsrn (4)
- # clojure (176)
- # clojure-conj (9)
- # clojure-dev (9)
- # clojure-germany (2)
- # clojure-italy (4)
- # clojure-spec (13)
- # clojure-uk (56)
- # clojurescript (72)
- # code-reviews (11)
- # cursive (17)
- # data-science (1)
- # datomic (52)
- # duct (26)
- # emacs (6)
- # events (9)
- # figwheel (1)
- # figwheel-main (21)
- # fulcro (132)
- # funcool (1)
- # graphql (3)
- # jobs-discuss (42)
- # leiningen (3)
- # luminus (45)
- # mount (10)
- # off-topic (2)
- # re-frame (17)
- # reagent (12)
- # reitit (20)
- # ring-swagger (7)
- # rum (3)
- # shadow-cljs (256)
- # slack-help (15)
- # sql (7)
- # tools-deps (50)
- # uncomplicate (1)
- # yada (9)
Is it possible to define two states in the same namespace and have one refer to the other? Right now I'm getting an error that seems like one state isn't started when I try to use it from the other.
@robert.mather.rmm yes, it is possible. can you share an example? also how do you start it: (mount/start)
or (mount/start .. only one state)
?
I'm using (mount/start)
. I think I have it figured out. Part of my issue was not understanding that I needed to make that call before any state was used. I guess in my head using a state would trigger lazy init of the transitive subtree from that node, but (mount/start)
is required before anything gets used. Just a misconception on my part. The other challenge is that I'm using Datomic Ions and trying to organize an init sequence that works the same way as on local, even though there's no 'main' called up there or repl to start from, it's ultimately just a callback so it's less clear how/when your app "starts" at a JVM level.
I'm using (mount/start)
. I think I have it figured out. Part of my issue was not understanding that I needed to make that call before any state was used. I guess in my head using a state would trigger lazy init of the transitive subtree from that node, but (mount/start)
is required before anything gets used. Just a misconception on my part. The other challenge is that I'm using Datomic Ions and trying to organize an init sequence that works the same way as on local, even though there's no 'main' called up there or repl to start from, it's ultimately just a callback so it's less clear how/when your app "starts" at a JVM level.
> in my head using a state would trigger lazy init of the transitive subtree
it would if you are in :cljc
mode and refer to state as @foo
: https://github.com/tolitius/mount#cljc-mode
> trying to organize an init sequence that works the same way as on local
from the mount perspective it will start in the order of: 1. component dependency 2. namespace compilation (i.e. if a
and b
are independent states that live in A
and B
namespaces, they would start in the order that compiler compiles A
and B
)
there seem to be an issue in cljs when a state :start
throws, I thought I got it covered but it still happens
I have something like :start (s/assert* :event-store.db/config (read-config))
when this throws, I see
store.db> @config/map
store.db>
which is not very helpful 😄
if this the state becomes a function call, then I see the exception