This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-18
Channels
- # announcements (35)
- # babashka (14)
- # beginners (23)
- # calva (5)
- # cljsrn (3)
- # clojure (154)
- # clojure-europe (12)
- # clojure-losangeles (2)
- # clojure-uk (5)
- # clojurescript (42)
- # conjure (3)
- # cursive (10)
- # datomic (3)
- # emacs (6)
- # events (1)
- # graalvm (1)
- # helix (1)
- # honeysql (1)
- # hyperfiddle (1)
- # jobs-discuss (1)
- # lsp (8)
- # malli (54)
- # meander (1)
- # membrane (1)
- # off-topic (246)
- # polylith (4)
- # practicalli (1)
- # re-frame (14)
- # releases (1)
- # shadow-cljs (21)
- # sql (58)
- # vim (1)
- # vrac (2)
What is the best way to deal with this situation: I have 2 components A
and B
, they both need to import each other, so this results in a Cyclic load dependency
error. How can I fix this without having to nest these components?
If they both use each other then you have several options:
• Merge the two components into one component.
• Extract the shared functionality into a third component that can be used by both A
and B
.
• Divide the functionality differently between A
and B
so that only e.g. A
depends on B
but not the other way around.
What is best differs from case to case, so good luck with the redesign!
Another option would be to split your interface.clj
into several ones (`interface/*.clj`) in a way you avoid the cyclic dependency
@U1G0HH87L @U0CL38MU1 Thank you guys, for the suggestions . I think i will try to merge both components, or split interface.