duct

2019-09-28T08:10:31.014Z

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

2019-09-28T08:20:12.015Z

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

2019-09-28T12:56:35.018900Z

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)

2019-09-28T13:09:28.022500Z

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?