Fork me on GitHub

{:db #ig/ref :xyz.database/master
 :logger #ig/ref :duct/logger
 :cache #ig/ref :xyz.cache/history}


You usually provide a component with dependencies and then use them.


Ok I think I'm starting to get it. And so some handler would be defined as a fn in it's init-key implementation? And every function that uses logging would be defined this way instead of defn, and called like

((xyz.handler/some-handler system) x y)


Like a handler example feels somewhat natural as a dependency. But what if I have a function which takes some data from an external API, saves it to a database, does some logging and returns the data. Should this function be defined with init-key and then called by looking up the function in the system map?