Fork me on GitHub
#om
<
2017-07-12
>
gardnervickers01:07:56

@sundarj it will just normalize a tree of data to the default Om.next db format. It does the opposite of generating trees, it generates a graph.

gardnervickers01:07:45

db->tree will generate your UI tree (or a subtree) depending on the query you pass into it.

sundarj01:07:04

yeah sorry about that, i was being a bit fast and loose with my terminology there. i managed to get it working in the end (with a hefty dose of hammock & repl time): https://github.com/sundarj/hiki/commit/99e1b8e4639f2a783d3a5286bbe61f1dff8bf05d

sundarj01:07:40

suspect there is a better approach than using a reset!, but it works for now

gardnervickers01:07:24

Cool, we've found (merge-with merge to work well for most cases where we want to merge the results of tree->db back into your app state.

sundarj01:07:27

did not know about merge-with! nice one :thinking_face:

sundarj01:07:31

https://github.com/sundarj/hiki/commit/f33c5c3db3087c19c263671da9cbc68b8b5346ce dont need merge-with since it's just merging into {:playlists nil}, but this is much nicer. thanks!

baptiste-from-paris18:07:55

hello friends, can someone explain to me what is a typical use case for (om/react-type some-component) ?