integrant icon indicating copy to clipboard operation
integrant copied to clipboard

Could load-namespaces be split off into a separate lib?

Open WhittlesJr opened this issue 6 years ago • 0 comments

I've found the strategy employed by your load-namespaces function to be generically useful for similar architectures that rely on multimethods and namespaced keywords.

I'm currently pulling integrant into a project that doesn't do any state management, just to get the functions called by load-namespaces. I had to make a more generic copypasta version for my own use:

(defn load-namespaces [kws]
  (doall (->> kws
              (filter keyword?)
              (mapcat #(conj (ancestors %) %))
              (mapcat #'ig/key->namespaces)
              (distinct)
              (keep #'ig/try-require))))

This works perfectly for me. What do you think about spinning this stuff off into a separate lib (or maybe adding it to medley?)

WhittlesJr avatar Oct 31 '19 16:10 WhittlesJr