Fork me on GitHub
#integrant
<
2021-11-23
>
rickmoynihan14:11:39

Firstly don’t be ashamed of passing {} it is useful information as {} should for that atom component be the initialisation state of the atom; i.e. you’d expect to see:

(defmethod :whatever/state [_ state]
  (atom state))
You can hide this sort of thing and defaults with ig/prep-key; though that can hide things a bit too much. I tend to structure integrant systems into profiles which are meta-merged. I have a base.edn which consists of the static config; stuff that is intended to be a sensible default or overriden elsewhere; and then a series of layered files / profiles that meta-merge ontop of base.edn… essentially I then do (apply meta-merge [base-profile ,,,, env-profile]) to build the config which I call ig/init etc on. Typically the final layer consists of some kind of environment profile i.e. dev.edn or a prod.edn or a test.edn etc…

Noah Bogart14:11:58

i forgot about prep-key! that’s helpful, yeah

Noah Bogart14:11:39

would you be willing to share any of your code? i think i get it but seeing code is very helpful for understanding