Fork me on GitHub
#om
<
2017-06-10
>
dnolen00:06:39

@julianwegkamp at this point it doesn’t seem that important? we can link to the old docs

julianwegkamp00:06:47

Perhaps not. I was triggered by om/IRender in the example but I think @anmonteiro already pointed that out in the PR

levitanong06:06:21

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?

gmercer12:06:57

@dnolen did you see this earlier - someone having problems with hello example out of the the box ?

gmercer12:06:38

not me - I just repeated what they did

gmercer12:06:36

slack-fu not that good ^^^ message from June 5th

dnolen12:06:59

@gmercer haven’t but I also don’t time to look into it, I’m sure someone else can help

gmercer12:06:27

nw - just thinking of the om OOTB experience

gmercer13:06:55

i.e. .. to build an example run:

lein cljsbuild once <build-id>
from om landing page on github gives disappointing results

devth14:06:20

given a component is there a way to traverse its children?

devth14:06:07

i want to assemble the state of a top level component and all of its children, recursively

devth16:06:15

next question: if a component A updates its parents' component state, A won't get re-rendered by default - how to force it?

gmercer16:06:07

@dnolen bumping to clojurescript 1.9.562 will get examples compiling

bbktsk16:06:29

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...