This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-15
Channels
- # admin-announcements (130)
- # alternate-reality (2)
- # aws (20)
- # beginners (49)
- # boot (1)
- # braid-chat (18)
- # cljsrn (54)
- # clojars (1)
- # clojure (70)
- # clojure-art (1)
- # clojure-japan (21)
- # clojure-miami (2)
- # clojure-my (7)
- # clojure-russia (60)
- # clojurescript (75)
- # community-development (12)
- # core-matrix (7)
- # cursive (23)
- # datomic (31)
- # dirac (2)
- # dunaj (3)
- # dysphemism (5)
- # editors-rus (1)
- # emacs (22)
- # events (9)
- # funcool (56)
- # hoplon (63)
- # human (1)
- # jobs (9)
- # ldnclj (7)
- # lein-figwheel (21)
- # leiningen (1)
- # off-topic (2)
- # om (61)
- # onyx (20)
- # other-lisps (2)
- # portland-or (1)
- # proton (26)
- # re-frame (27)
- # reagent (16)
- # ring-swagger (30)
- # spacemacs (6)
- # yada (5)
Good evening all! Is there a way in om.next to set a query on a component prior to it being mounted? Problem I have is that, when I mount the component, the param is essentially nil and when it tries to fetch the data it obviously doesn't work...should I implement the shouldComponentUpdate and check if param is nil some way?
I guess by using set-query! prior to render, you can remove the read in the case of a nil param. don't know if that's a good approach or not
I'm just thinking if my read method returns nil instead of {:value ...} I'm not going to cause issues down the road?
yeah, I think a render is triggered in either case, when using set-query! to remove a key, or set a param
@griff: thats true, so if I want to query just for an ident I have to normalize the data myself?
re: Links
is it possible to pass an actual query instead of [:current-user _]
? I have a current-user
that has a bunch of posts that have been normalized so I get
{:current-user {:user/posts [[:post/by-id 1] [:post/by-id 2]]}}
ohh so I misread your https://clojurians.slack.com/archives/om/p1452872327011008
on my side
@anmonteiro: are you getting denormalized values, in this case the user posts?
@denik: I wasn't
@denik: let me have a look again
@anmonteiro: nevermind didn’t pass join query-segment
what do you mean by that?
@anmonteiro: had to pass (parser {:state reconciler} '[{[:current-user _] [{:user/posts [:post/name]}]}])
makes sense
I wasn't seeing that
actually
it should work
I think
@anmonteiro: well it looks like it does not
@denik: neither does the one with the join-segment
for me at least