;; Following works with composite key.
(defmethod ig/init-key ::sugared-greet [_ {:keys [name]}]
(println "Hi" name))
;; Following doesn't work with composite key.
(defn sugared-greet [{:keys [name]}]
(println "Hi" name))
(def config
{[::sugared-greet ::a] {:name "Alice"}})
(ig/init config)
While trying to use normal function in composite key, I found that it doesn't work, but ig/init-key variant works.
Is it expectation or bug?
Ref: https://github.com/weavejester/integrant?tab=readme-ov-file#initializer-functionsIt's a bug, or rather something I didn't think of when I wrote the syntax sugar. It should be easy enough to fix though - we check if the key's a vector, and if so we iterate through and check each keyword within it.
Open an issue for it on the Integrant repo and I'll get it fixed.