@zane: can you give a simple example (of how states are connected)? also are you running (mount/start)
or (mount/start a b c)
?
@tolitius: I figured it out. State b
was dependent on state a
, but a
was being replaced with b
via mount/start-with-states
. (Overriding a production config with a development one.)
How do people organize their defstate
s? Separate namespaces, or co-located with related non-mount code?
@zane: I've seen several approaches: 1. Have a defstate and functions that use (i.e. reference) it in a single namespace 2. Have defstates defined with accordance to the module / package / layer / namespace of an application 3. Have defstates defined in a single place and referenced from other namespaces
Right on. None of those is more idiomatic than any others?
I would say it depends.. i.e. for data access I would have a defstate
of the db connection and query functions in the same ns, or if there are many of those, would separate them out into read/write/delete ns.. for config and other ubiquitous states, I would keep them all in one place and reference them from other namespaces
but again depends on what your preferences / requirements are