om-next

lgastako 2016-03-01T08:09:25.000034Z

Can anyone tell me why I get "No queries exist for component path (mx.core/MainView mx.core/NavView)”) if I just pass all props to nav-view at line 53 (i.e. (nav-view (om/props this)) instead of pulling out the current tab and passing it in as I’ve done? https://www.refheap.com/115387#L-53

2016-03-01T15:14:30.000035Z

@lgastako: The props returned from om/props contains metadata that has the path from the root that lead to the component. Queries also contain metadata that refers back to the component and is used to create the path. Since your MainView query doesn't refer to NavView's query, then the reconciler can't work the query backward to do the indexing. Pulling the props out and creating a new map elides the metadata and so om doesn't try to reconcile the query backward.

2016-03-01T15:15:15.000036Z

@lgastako: disclaimer, that response includes a lot of guessing and conjecture

lgastako 2016-03-01T19:07:59.000037Z

@cmcfarlen: thanks… that makes sense at a high level, but what would I need to do to refer to NavView’s query in MainView so that it could work the query backwards? Both views already use the same query?

2016-03-01T21:28:07.000038Z

Since the query is the same, perhaps just have MainView and create a function that just returns the sablono vector and pass it the props. Then not have the NavViews component.

2016-03-01T21:28:47.000039Z

If you want it to be a component, you can nest the query: [{:nav (om/get-query NavView)}]

lgastako 2016-03-01T22:58:25.000040Z

The example code was extracted from a more complicated case in real life, but I’ll meditate on this and see if I can work out the “right” way to do it for my case. Thanks again.