Please give an answer of the “untangled-devguide.E-UI-Queries-and-State-Exercises”. ( With the graph-db already set,how will you chain the total-query with an intermediate ui-component without the query-expression.)
@eric.shao: Would using get-query
help? (sorry haven't looked at the exercises) - that's how you use the query of another component.
@cjmurphy thank you for rpl. yes, I want to use ’get-query to chain them throuth.but … (components structure: Root->PeopleWidget->Person)(db-structure: db-map -> :widget ->:people ->person) (query-structure: Root -> Person)
ooops
@codxse I didn’t realize I had put that anywhere publicly visible 😕
crap…totally my bad
no problem
I’m going to back that out
🙂
reverted.
@eric.shao I think on that one there is a component that has no state…and as far as “stateless” components go, you just don’t involve them in the query, and they can pass props through unchanged. In other words, they’re sort of invisible. You’d compose the query of the child up to the stateful parent. It isn’t the best example, and I should update the exercises. It is really rare that a component would be involved like that and have zero state.
that’s why there is no TODO in the middle one
hm..that may not be right. It’s been a long time since I wrote that exercise. I’d have to pull the source and do it…and at that point I should probably just rewrite it
Not a bad idea to use the youtube videos. They are a bit more up to date. They are short segments (like 20 mins each) and most ppl find them quite useful.
@tony.kay Thank you~
[:new-person :last-error {:widget [{:people (om/get-query Person)}]}] two-levels-join donesn’t work,right?
I am not a english-native, so the text-tutorial is more clear for me.😀
[:new-person :last-error {:people (om/get-query Person)}]
- just one vector on the outside. See the Kanban demo for all of this kind of Om.Next stuff put together.
https://github.com/Jannis/om-next-kanban-demo - is very good for just reading code for a real application, that includes CSS etc. <<- @eric.shao
@cjmurphy but the db-structure is : db-map -> ‘:widget’ ->:people ->person)
The two (or more) levels join happens by composition, so [:new-person :last-error {:widget (om/get-query Widget)}]
. And then the Widget component might have the query [{:people (om/get-query Person)}]
What @cjmurphy said. I think the exercise is not so great. Putting a query on the middle component does make it match up better. You’d never structure a real app the way the guide is asking you to.