@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 ?
not me - I just repeated what they did
slack-fu not that good ^^^ message from June 5th
@gmercer haven’t but I also don’t time to look into it, I’m sure someone else can help
nw - just thinking of the om OOTB experience
i.e. .. to build an example run:
lein cljsbuild once <build-id>
from om landing page on github gives disappointing resultsgiven a component is there a way to traverse its children?
i 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?
@dnolen bumping to clojurescript 1.9.562 will get examples compiling
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...