Fork me on GitHub
#om
<
2016-12-24
>
fenton01:12:09

@sova remember an html page is a tree, with the root being an <html> tag, so this shouldn't seem too foreign.

sova03:12:30

@fenton thanks man, I guess my question is, do you have a single Om.root call in your program? And, if that is the case, then I have a "root component" with (defui ...) and all my other components are called from within that? I'm just wondering about how om works best ... with one single .js object mounted on <div id="app"></div>?

sova03:12:46

Hey, forget what I said! I didn't see the other messages in the channel xD

sova04:12:51

@danielstockton do you think you could link to an example where the queries of the (sub)components are deferred via (om/get-query ComponentClass) ?

fenton04:12:10

@sova check the quick start wiki...I often go back to the identity one or thinking in links...I think there are examples there

sova04:12:47

@fenton Yo I just understood what you said, it took me a minute to grok the parallel between html hierarchy and the component nesting. Finally getting something nested to render makes me a happy newdev (om/factory makes it invokable just as its own name ... caveat i did not really get until now)

fenton05:12:33

@sova everything UI is a tree/hierarchy. However sometimes you'll have the same data at different spots in your tree... But in your DB, you want it to be DRY, so it only exists in one spot. To handle that, links are used. then you hydrate your query tree of links with db->tree. This is the meaning of the quote at the top of the "Thinking with links" wiki page: "There is no Tree, only Graph" -- The Ancients. Your DB is the graph, with nodes that POINT/REFER/LINK to other data, then you create a view of that graph and de-normalize it so the same data appears in many places, thus hydrating a graph into a tree so to speak.

danielstockton08:12:40

I need to get myself on a different timezone. @ag I use compassus for routing, but the problem I have is based on routing a lower level component. Also, routes come from the url which is client-side, I want to route based on something from the server. I think it will work with mitchelkuijpers suggestion to bootstrap config into the html and then using optimistic updates when transacting.

azzikid22:12:36

hey everyone. little christmas eve problem: i am optimistically adding data to the state in my app, and then making a request to a server with the new item. i get back a confirmation hash that i want to merge back into the state (use it for later requests). so i am using the :send hook to make the request, and then the callback to update the state. there in lies the issue - the callback replaces the state. it does not properly merge.

azzikid22:12:57

i tried using the merge hook but can't really see why something like (cb {:items item-confirmation}) doesn't merge item-confirmation into the :items map.

azzikid22:12:29

it overwrites everyting that was in the :items map. also if it matters, my state is normalized