This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-06
Channels
- # admin-announcements (1)
- # alda (2)
- # beginners (5)
- # boot (59)
- # clara (6)
- # cljs-dev (40)
- # cljsrn (32)
- # clojure (28)
- # clojure-austin (1)
- # clojure-belgium (67)
- # clojure-greece (60)
- # clojure-ireland (1)
- # clojure-japan (1)
- # clojure-russia (55)
- # clojure-spain (14)
- # clojure-spec (39)
- # clojure-uk (26)
- # clojurescript (152)
- # clojurewerkz (1)
- # cursive (21)
- # datomic (3)
- # dirac (15)
- # emacs (7)
- # events (2)
- # funcool (4)
- # hoplon (43)
- # immutant (1)
- # lambdaisland (1)
- # lein-figwheel (6)
- # leiningen (1)
- # off-topic (1)
- # om (23)
- # onyx (67)
- # other-languages (6)
- # pedestal (7)
- # planck (13)
- # proton (3)
- # protorepl (2)
- # re-frame (6)
- # reagent (5)
- # ring-swagger (6)
- # spacemacs (1)
- # specter (2)
- # yada (27)
can someone help me with a query syntax… if I have something like this:
static om/IQuery
(query [this]
`[{:app/main-menu ~(om/get-query TopNavBar)}
({:app/cur-route [:app/routes]} {:active-route ?active-route})
])
I assumed that in :app/cur-route
’s read
active-route
parameter would show up, but I think there’s something not right with that tricky macro syntaxThere's experimental support in om.core
for components with "local" state which is implemented by storing that state in the app state atom. Is there anything similar in om.next
? Or, is there an orthogonal way to achieve something similar?
@peeja: you can implement ILocalState
https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L198
If I did that, and wanted to apply that to all of my components, how would I do that? Om doesn't do mixins, correct? (And they're deprecated in React anyhow, IIRC?)
Is there a sensible way to compose a component with something that implements ILocalState
?
@peeja: nothing comes to mind other than wrapping defui
in a macro
perhaps there’s some other way that I can’t think of right now
Yeah, that might do. I'll dig into it if it seems like a direction we want to go it. I've been curious for a while whether there's an expected way to do things like that that I was missing, but it sounds like it's still an open question.
Trying to follow Antonio Monteiro's instructions for routing via set-query and the remote reads don't happen. After the mutation ('app/change-route! in the example) the read function is called, with the query I expected, and the query has the meta I expected. I've looked at full-query as suggested but I'm still lost. The post is here: https://anmonteiro.com/2016/02/routing-in-om-next-a-catalog-of-approaches/
Can you help me understand "It'normal that Om Next sends the full query of the component to the parser following a mutation" in this context?
When a component initiates a transaction like [(app/do-something)]
Om will grab the query for the component initializing the transaction and append that to the transaction query as a “follow on read” because it assumes the component that is transacting will need to re-render. So if that components query is [:foo :bar]
and it is rendered from the root as {:my-c [:foo :bar]}
then the actual query for the transaction will be [(app/do-something) {:my-c [:foo :bar]}]
. Disclaimer: this is my understanding and I may be wrong on the specifics.
Is it acceptable for the second element of an ident to be a data structure rather than a scalar value? In DB terms, I'd like my "primary key" to be a composite key. Can I have, for instance, [product/by-manufacturer-and-model-number [:acme "ABC123"]]
?
@peeja: I think it works in practice, but it’s not supposed to be