Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WhittlesJr opened this issue Oct 31, 2019 · 0 comments
Open

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

WhittlesJr opened this issue Oct 31, 2019 · 0 comments

Comments

@WhittlesJr
Copy link

WhittlesJr commented Oct 31, 2019

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 WhittlesJr changed the title Could load-namespaces be split off into separate lib? Could load-namespaces be split off into a separate lib? Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant