This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-21
Channels
- # beginners (38)
- # boot (88)
- # cljs-dev (142)
- # cljsrn (2)
- # clojars (1)
- # clojure (107)
- # clojure-berlin (2)
- # clojure-italy (8)
- # clojure-russia (76)
- # clojure-spec (325)
- # clojure-taiwan (3)
- # clojure-uk (28)
- # clojurescript (80)
- # clojurewest (2)
- # core-async (36)
- # core-logic (1)
- # cursive (21)
- # datomic (16)
- # dirac (18)
- # docs (2)
- # emacs (1)
- # euroclojure (3)
- # garden (3)
- # gsoc (2)
- # hoplon (3)
- # immutant (4)
- # jobs-discuss (16)
- # lein-figwheel (5)
- # liberator (17)
- # lumo (19)
- # off-topic (2)
- # om (20)
- # onyx (28)
- # pedestal (50)
- # planck (4)
- # re-frame (5)
- # reagent (3)
- # ring-swagger (13)
- # spacemacs (1)
- # specter (43)
- # testing (3)
- # timbre (3)
- # uncomplicate (1)
- # vim (2)
- # yada (4)
I have the following component hierarchy: Wrapper -> Header -> Nav -> [Dropdown1, Dropdown2, Dropdown3]
Dropdown1, Dropdown2, Dropdown3 can change based on route (effectively I want a secondary routing system alongside compassus for main routing).
I want to be able to add root queries to Dropdown1, Dropdown2...How would you do this?
@jannis What would the query look like in Wrapper, Header, Nav? I was thinking it would involve some recursive parsing like in https://awkay.github.io/om-tutorial/#!/om_tutorial.E_State_Reads_and_Parsing
Do you always need to hike the child query into the parent or can you have a query with a link just floating in space?
What I’m doing these days is recursive parsing with a single read
entry point, using my own query engine and data store. You can lose some of Om Next’s features that way though.
I think it will work with something like this:
(defmethod read :header
[{:keys [query parser] :as env} _ _]
{:value (parser env query)})
(defmethod read :nav
[{:keys [query parser] :as env} _ _]
{:value (parser env query)})
for all the intermediary components..It just nests it under the key and delegates the query to the next level.
That by itself doesn’t solve the problem but I never liked the idea to use join keys that are tied to the UI just to pull in sub-component queries. So I decided to never do that and always only join on actual data / entities.
Yeah, I don't like it either but I can't see another way other than inventing my own query engine, as you say...
I wrote
(defmethod read :delegate/nav
[{:keys [query parser] :as env} _ _]
{:value (parser env query)})
and I just use this key in all components that I want to just pass props through...
Not sure if this is a good idea or not but it works.hi all, super newb here... can anyone give me pointers to any overviews on why I'd pick either om.dom
or sablono? I presume there's a reason they both exist, and I'm guessing there's some extra stuff that om.dom
is doing.
@rgm choose what you prefer. the only thing to be aware of is that sablono won’t support server-side rendering if you eventually want to go through that path
seems like they mix/match/compose, so if I were feeling particularly hostile to future-me I could om.dom only the parts that I currently guess would benefit from SSR.
seems to be pre-om.next but I guess this'd be another pro of om.dom ... http://swannodette.github.io/2014/02/27/taking-off-the-blindfold
Changing file extensions from .cljs
to .cljc
and seeing my UI loading instantly with SSR was extremely satisfying
hello guys, any recommandation for validation in forms ? I am not talking about the validator
key in factory which assert props (and then throw an error if it goes wrong). I am more talking of a strategy to validate user’s input
Do you use simple components ?
@baptiste-from-paris use Spec.