Fork me on GitHub
#om
<
2017-03-14
>
danielstockton11:03:17

Is there any way to make a select component whose query does not compose back to root? I don't want to have to pass props through for every select, I thought I might be able to do this with an Ident.

danielstockton11:03:19

The parser is being called but om doesn't seem to be passing props to the component. I made my own lookup table on state :select/by-id. I'm also adding the ident as a tailing argument to transact!

danielstockton11:03:38

It would be a good fit for component local state but I would quite like to store things in app-state if possible.

dvingo13:03:30

is the component being re-rendered?

danielstockton14:03:31

I've changed it to use component local state for now but I'd like for it to be built into app-state so I can jump across all the states.

danielstockton14:03:21

I thought maybe the component isn't being indexed because I'm not including the query in a parent and composing to root..

dvingo14:03:22

if it's not re-rendering but the data is updating in the reconciler you could try a "read transact" (om/transact [:select/by-id ~id]) i've used that pattern for remotes data updates to trigger updates, haven't tried from the parser though

dvingo14:03:41

ah, rereading what you said, i think you'll need the select component's query in your root, you may not have to pass the data down as long as its query is present in the root

danielstockton14:03:29

I see, in that case I'd need a huge list of idents in my root component for all the select menus in my application

dvingo14:03:31

looks like you can have free reign into how a component gets its data

danielstockton14:03:54

Oh, another hidden gem for me to abuse 🙂

dvingo14:03:57

haha yea, i haven't played with that yet, but i probably will get there - i'd really like to avoid having to wire all the state down the ui tree

tony.kay23:03:07

I recently uploaded a video directed at helping people understand how we handle state, remotes, and the removal of a need for a client-side Om Next parser in Untangled. Thought it might be interesting to those of you that are thinking through the Om Next patterns. Might shed some light. https://www.youtube.com/watch?v=mT4jJHf929Q

dvingo23:03:04

this is great, thank you!