This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-10
Channels
- # aleph (1)
- # beginners (39)
- # boot (14)
- # cider (2)
- # clara (6)
- # cljs-dev (39)
- # cljsrn (2)
- # clojure (276)
- # clojure-italy (1)
- # clojure-russia (22)
- # clojure-sg (2)
- # clojure-spec (7)
- # clojure-uk (9)
- # clojurescript (47)
- # core-async (1)
- # cursive (5)
- # emacs (1)
- # events (3)
- # leiningen (1)
- # luminus (2)
- # lumo (75)
- # om (14)
- # onyx (1)
- # parinfer (11)
- # pedestal (1)
- # ring-swagger (2)
- # spacemacs (4)
- # untangled (5)
- # yada (29)
@julianwegkamp at this point it doesn’t seem that important? we can link to the old docs
Perhaps not. I was triggered by om/IRender in the example but I think @anmonteiro already pointed that out in the PR
If one is using pushy
or goog.History
, where would one put calls to these APIs in om.next? On one hand, it’s most straightforward to call it inside a mutate
, but this is one of those things that don’t exactly touch app state, which leads me to think it should be contained in a remote. However, that seems a little roundabout. Does anyone have any ideas on the matter?
@dnolen did you see this earlier - someone having problems with hello example out of the the box ?
@gmercer haven’t but I also don’t time to look into it, I’m sure someone else can help
i.e. .. to build an example run:
lein cljsbuild once <build-id>
from om landing page on github gives disappointing resultsi want to assemble the state of a top level component and all of its children, recursively
next question: if a component A
updates its parents' component state, A
won't get re-rendered by default - how to force it?
I’m still having trouble wrapping my head around how om works, or at least, making sure I understand it correctly. Let me give an example what my current understanding is, please let me know whether it is correct or not. Assume I’m writing a Person component and I want be able to use it both as a item in a list of users and also as a singular, for example, displaying a selected user. There’s a :person/by-id
key in the app state, containing map of ids to personal data. Person’s query’s going to be [:person/id :person/firstname :person/lastname]. The
read` function for these keys will assume that env
contains my own, custom key, e.g. :person/current-id
, whose value is a person’s id and use it to extract corresponding id, firstname and lastname from the state. When displaying a list of persons, the query for the parent component will contain {:person/list (get-query Person}
, read
for :person/list
will, for each person, recursively call parser with :person/current-id
added to the env
with id of the current person and collect results to a vector, render
of parent will just iterate over the vector and pass each item to Person factory. When displaying a singular person, the query of the parent component will contain {:person/selected (get-query Person)}
, read
for person/selected
will set :person/current-id
in env to correct value, call parser recursively and return the result. If a Person component needs to do some changes in the state, it just uses the id it got in props: (transact! this '[(person/feed ~id)]
(should be a backtick). Is this a correct approach? Sorry for the long-winded post...