This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-17
Channels
- # announcements (45)
- # asami (30)
- # babashka (96)
- # beginners (24)
- # calva (43)
- # chlorine-clover (3)
- # cider (10)
- # clj-kondo (45)
- # cljdoc (10)
- # cljs-dev (2)
- # clojars (5)
- # clojure (139)
- # clojure-australia (5)
- # clojure-europe (53)
- # clojure-filipino (1)
- # clojure-germany (27)
- # clojure-nl (4)
- # clojure-provo (7)
- # clojure-serbia (6)
- # clojure-spain (1)
- # clojure-uk (8)
- # clojuredesign-podcast (8)
- # clojurescript (76)
- # code-reviews (6)
- # conjure (4)
- # core-async (1)
- # cursive (73)
- # data-oriented-programming (2)
- # data-science (3)
- # deps-new (4)
- # depstar (7)
- # docker (16)
- # duct (7)
- # events (1)
- # fulcro (13)
- # girouette (1)
- # graphql (4)
- # honeysql (11)
- # jobs (2)
- # joker (1)
- # kaocha (4)
- # leiningen (5)
- # malli (11)
- # off-topic (14)
- # other-languages (1)
- # pedestal (4)
- # practicalli (1)
- # re-frame (5)
- # reagent (3)
- # releases (2)
- # remote-jobs (7)
- # shadow-cljs (12)
- # sql (24)
- # startup-in-a-month (2)
- # tools-deps (99)
- # vim (8)
- # vscode (1)
- # xtdb (28)
The key requirement is laziness. I want to make it so that the initial remote request only asks for one level. Further requests for listing files in the sub-folders will only be sent when the triangle is clicked.
I read through https://book.fulcrologic.com/#_recursive_queries but still have questions. How would you design the stated component?
I'd imagine the initial request be something like this:
[:dir/id :dir/name
{:dir/files [:file/id :file/name]}
{:dir/sub-dirs [:dir/id :dir/name]}]
Another unrelated question: can I have a UI state :ui/xxx
that is not shared between different views on the same entity? I don't want to use separate ids for them because I want the remote props be linked. This is very common requirement for e.g. implementing checkboxes on a tree view that have one node appearing at multiple locations.
I would personally recommend using hooks for this. It's easy to reason about and it becomes very obvious that that is local state. And it works really well with Fulcro. Just set use-hooks? To true
You can always use component-local state if you want a component-local value that is not part of the actual state in the fulcr odb