This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-17
Channels
- # admin-announcements (4)
- # beginners (21)
- # boot (37)
- # cider (41)
- # cljs-dev (3)
- # cljsjs (11)
- # cljsrn (4)
- # clojure (31)
- # clojure-austin (21)
- # clojure-belgium (30)
- # clojure-canada (1)
- # clojure-dusseldorf (2)
- # clojure-poland (7)
- # clojure-russia (20)
- # clojure-taiwan (1)
- # clojure-uk (45)
- # clojurescript (90)
- # core-async (8)
- # cursive (4)
- # data-science (1)
- # datomic (5)
- # dirac (6)
- # docker (1)
- # emacs (8)
- # hoplon (102)
- # ldnproclodo (2)
- # lein-figwheel (3)
- # leiningen (13)
- # off-topic (9)
- # om (54)
- # onyx (4)
- # other-languages (101)
- # pedestal (8)
- # planck (2)
- # protorepl (1)
- # re-frame (15)
- # reagent (13)
- # spacemacs (4)
- # untangled (126)
- # yada (4)
@danburton: hey Dan… I think IQueryParams
is what you need
errr… someone please help me with a query. if I have a data like this
[{:foo :wack}{:foo :quack}{:foo :wack}{:foo :stuck}]
and I need to select only items where (= :foo :wack)
how should the query look like?basically I need to render 2 lists in one of them I need to include everything that (= :foo :wack)
and in the second I need to include everything that (= :foo :quack)
you can define 2 read funcs, like this wack-items and quack-items each of those you just return (filter (fn [[k v]] (= v :wack / :quack)) (:data @state)))
I have a question. I've just took the macro approach as in om.dom to create macros for some webcomponents (instead of wrapping them with defui). But does that means I am not taking advantage of om shouldComponentUpdate hook? if so, is there a way I can add it without giving up on the macro approach?
@dnolen: I get the feeling this has worked before. Is this supposed to work?
(defui User
static om/Ident
(ident [this {:keys [id]}]
[:user/by-id id])
static om/IQuery
(query [this]
[:id :user/name {:user/posts (om/get-query Post)}]))
(defui Post
static om/Ident
(ident [this {:keys [id]}]
[:post/by-id id])
static om/IQuery
(query [this]
[:id :post/title :post/content {:post/authors (om/get-query User)}]))
as in the circular reference between users and posts
probably got to define some other component which doesn’t have the circular reference. something like Author
or something
@anmonteiro: I've run into this and ended up making a 3rd component. It worked out because it turned I needed a bit different query the other way. Still its probably common.
I wonder if you could use the back reference syntax from datomic to resolve (or detect) these circular references. So use {:users/_posts (om/get-query User)} instead
@iwankaramazow: just reading your answer now, thanks!!
@anmonteiro: pretty sure that never worked
currently not sure how it would since there’s no way to control the depth of that kind of recursion
@jasonjckn: some people are building production stuff with it yes
@dnolen: Om Next is amazing! You guys are awesome! I just convinced my team to use it for our next project.
basically I bet my career on it - team agreed, now I have to become an expert in very short time and build something tangible and evangelize everyone in my team. @dnolen - no pressure 🙂
@ag cool, i'm in the process of evaluating various stacks for the v2 of our product
we are Clojure shop and yes, a few people know CLJS, but we have few front-end engineers that still hanging around Rails realm
for the sake of a few people (including myself) who think that Clojurescript is the best way to target front-end I have to succeed with Om Next. or Product may decide otherwise (bitter reality)
@jasonjckn: not currently no, pretty busy at Cognitect
@jasonjckn: I don’t work on consulting stuff, that said a few people have been playing around with Om Next and quite a few people are familiar with Om from other projects
sorry for breaking the conversation: I’m struggling with something here, can someone guide me please. so I need to render 2 components that differ only by their IQueryParam, so what's the best way of doing something like that? my initial thought was to create one component and then use set-query!
but I couldn’t make it work
@jasonjckn: I assume some-component
should be a factory, right?
still unclear how to get 2 components (factories derriving from same component) with different params and render them in another component
guys, please someone help me. here. I have a component with a query that looks like this:
static om/IQuery
(query [this]
'[(:ledger/data {:account-type ?account-type})])
now I need to render 2 instances of this component in another component, where:
1st would have :account-type :checking
2nd would have :account-type :saving
Seemingly trivial task and yet I can’t find the right way of doing this.posted a question: http://stackoverflow.com/questions/37287844/reusing-components
@ag: well you would add a read method that checks the params to return specialized data. I don't use params much, maybe there is a simpler way to do this in your use?