Hey everyone, I’m having trouble using mount with cprop. I have the following code:
(defstate env
:start
(load-config
merge [foo bar]))
However it seems like it’s not working, in the repl I get #<DerefableState@...> :not delivered and when I run it with lein run it seems like it’s not loading config.edn because I can’t use the variables declared in the file.
If I declare env to be a regular variable like (def env (load-config ...)) it works perfectly fine.
Additionally, in the same project im using mount with a datomic connection and that one works perfectly fine. So I’m not really sure what’s happening here.
My hole project is a website and I’m using luminus.
Any tips on how to fix this? What could go wrong if I use a regular (def env ...) instead of defstate ? I only want to load some static values like db connection parameters and names.
Thanks!have you started mount? Calling
(mount.core/start)
will replace the value of env with the actual state