untangled

NEW CHANNEL: #fulcro
eric.shao 2017-04-09T03:51:22.874161Z

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

cjmurphy 2017-04-09T04:02:34.899253Z

@eric.shao: Would using get-query help? (sorry haven't looked at the exercises) - that's how you use the query of another component.

eric.shao 2017-04-09T04:07:27.910563Z

@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)

tony.kay 2017-04-09T04:16:04.927984Z

ooops

tony.kay 2017-04-09T04:16:19.928536Z

@codxse I didn’t realize I had put that anywhere publicly visible 😕

tony.kay 2017-04-09T04:16:52.929652Z

crap…totally my bad

2017-04-09T04:16:58.929805Z

no problem

tony.kay 2017-04-09T04:16:59.929809Z

I’m going to back that out

2017-04-09T04:17:00.929870Z

🙂

tony.kay 2017-04-09T04:19:11.934426Z

reverted.

tony.kay 2017-04-09T04:35:31.969152Z

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

tony.kay 2017-04-09T04:35:44.969558Z

that’s why there is no TODO in the middle one

tony.kay 2017-04-09T04:36:35.971332Z

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

tony.kay 2017-04-09T04:37:34.973204Z

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.

eric.shao 2017-04-09T04:40:44.979460Z

@tony.kay Thank you~

eric.shao 2017-04-09T04:43:33.985612Z

[:new-person :last-error {:widget [{:people (om/get-query Person)}]}] two-levels-join donesn’t work,right?

eric.shao 2017-04-09T04:45:42.989999Z

I am not a english-native, so the text-tutorial is more clear for me.😀

cjmurphy 2017-04-09T05:02:15.023533Z

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

cjmurphy 2017-04-09T05:04:06.027156Z

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

eric.shao 2017-04-09T05:23:56.065241Z

@cjmurphy but the db-structure is : db-map -> ‘:widget’ ->:people ->person)

cjmurphy 2017-04-09T05:58:53.130708Z

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)}]

tony.kay 2017-04-09T06:00:01.133014Z

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.

eric.shao 2017-04-09T16:09:32.639206Z

@cjmurphy @tony.kay Thank you very much!😄