This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-21
Channels
- # announcements (1)
- # babashka (13)
- # beginners (85)
- # calva (1)
- # chlorine-clover (16)
- # cider (30)
- # clj-kondo (2)
- # clj-on-windows (5)
- # cljdoc (3)
- # cljs-dev (12)
- # cljsrn (19)
- # clojure (88)
- # clojure-europe (39)
- # clojure-nl (7)
- # clojure-sweden (3)
- # clojure-uk (8)
- # clojurescript (35)
- # core-async (3)
- # data-science (2)
- # datomic (17)
- # defnpodcast (3)
- # deps-new (1)
- # editors (18)
- # emacs (4)
- # events (1)
- # expound (1)
- # figwheel-main (8)
- # fulcro (9)
- # graalvm (2)
- # graalvm-mobile (11)
- # helix (44)
- # jobs (7)
- # lsp (95)
- # luminus (9)
- # malli (6)
- # meander (4)
- # membrane (2)
- # missionary (13)
- # off-topic (98)
- # pathom (2)
- # polylith (4)
- # portal (3)
- # re-frame (6)
- # reagent (27)
- # reitit (3)
- # releases (3)
- # remote-jobs (6)
- # rewrite-clj (1)
- # rum (2)
- # sci (3)
- # shadow-cljs (7)
- # sql (66)
- # tools-deps (80)
- # vim (5)
- # xtdb (3)
Hang onto your hat, @marques.goncalves.fel: https://github.com/day8/re-frame/wiki/Dynamic-Subscriptions
The thing is, you do not really even want a subscription on an individual IDs: you do want to see them all. Your code should look like that anyway. And I believe other TodoMVC requirements specify changes when all-complete, so the bulk all-complete? will save recomputation if done once in the signal graph.
Hi, Kenny, thanks for the answer. The dynamic subscription seems to do the trick. But the docs seems do imply that I shouldn't need it. 😓 Giving you more details about my use case, I have a form that act as a container of sub-forms. Based on the value of the first input field, I may render one or more sub-forms, which will have an ID. I want to have a subscription that provides a complete view of the form (including its subform). So I would basically subscribe to the sub-form data based to a value in the DB. So this kind of drives me to the dynamic-subscription solution. But should I be using the form-1 with two subscriptions depending on each other as I did in the example? (I'm also more inclined to have a subscription combing the info, because I can write tests against it without worrying about the view.)
I would just have a subscription that delivers the form and all its sub-forms and pick and choose the info I want from the whole wodge. Are you worried about performance?
No, more about semantics and readability. Thanks for the inputs!