This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-31
Channels
- # aws (1)
- # beginners (70)
- # boot (12)
- # calva (45)
- # cider (45)
- # clara (1)
- # cljdoc (10)
- # cljs-dev (133)
- # clojure (315)
- # clojure-dev (2)
- # clojure-europe (2)
- # clojure-italy (16)
- # clojure-nl (1)
- # clojure-spec (23)
- # clojure-uk (19)
- # clojurescript (48)
- # cursive (11)
- # data-science (5)
- # datomic (18)
- # figwheel-main (3)
- # fulcro (18)
- # graphql (14)
- # jackdaw (1)
- # juxt (1)
- # kaocha (1)
- # off-topic (10)
- # other-languages (3)
- # pathom (2)
- # pedestal (7)
- # re-frame (23)
- # reagent (1)
- # reitit (4)
- # ring-swagger (12)
- # rum (4)
- # shadow-cljs (26)
- # specter (6)
- # speculative (12)
- # tools-deps (44)
- # vim (8)
- # yada (2)
is there any kind of... canned controllers for re-frame?
I mean, things bigger than "components", things like a master-detail flow, or a table with slice-n-dice filtering.
because if not, I'm planning to build one <_<
it can be a little difficult to build "canned" components for re-frame because it needs to have all of the subscriptions/effects/etc. registered in the global registry
so you need to make sure you namespace your keywords, and design it in a way that is flexible enough that applications can easily include and hook into it
@lilactown yeah, another way to do it is that you let the caller provide the keywords to be used when registering things
that's more or less what I'm planning
I'm heading toward the path of having components take subscriptions in their arguments
@mattly @braden.shepherdson remember that subscribe
takes a vector as its argument, and with components, that vector normally includes an id
of some kind to identify the data on which the component is operating. And often that id
is really a path
within app-db
.
So your component needs to take arguments, which are path-ish ids, and then you can assemble the vector
which is given as an argument to the subscribe
.
The same can happen with any component-embeded dispatch
Apologies if I'm stating the obvious ... but the key insight is that the argument is both subscribe
and dispatch
is data (a vector). As a result, that data can be "assembled" within a component.
@mattly I'm stressing this point because you talked about components taking subscriptions as arguments. Better, i think, to make the components take data as arguments - data which is then used (within the component) to construct the argument which is given to a subscribe
(or dispatch
)
So I'm encouraging you to be slightly more data oriented.
the thing I work on with re-frame most these days is mostly a internal developer-oriented debugging tool
and as such I've found that I need a lot of "generic" viewing components that can point at any number of data sources
so this practice has stemmed from, I don't want to invent a query grammar on top of subscriptions
Fair enough. Hard for me to comment further on the specifics of your case.
Just trying to throw out ideas