Fork me on GitHub
#om
<
2018-05-02
>
sova-soars-the-sora11:05:08

Gotta admit, recursive queries got me stumped a bit. Ideally my data is a tree, nested in the way that the recursion would like, and then a General component invokes a sub component that draws the recursion... seems simple enough in concept but I'm having trouble figuring out how to map it to my om.next ui code. If someone who is knowledgable has a minute to check over some code I'd really appreciate it. 😃

sova-soars-the-sora21:05:25

I've got a much better grasp of what needs to be in place for recursion to work, namely you need reader functions that will do what you want, and maybe i'll compile an index of all the various om.next reader functions that are littered about ... i'm not fluent enough to write roll my own and having a list would probably help the next person.

sova-soars-the-sora21:05:34

for my comment tree which has 3 comments and 2 nested comments for a total of 5, I have 5 divs rendering! yay! success... except that I cannot uniquely identify the divs, so they're either all empty divs, or i supply {:keyfn :cid} but then they stop rendering =(

sova-soars-the-sora21:05:25

Data structure / atom looks like:

sova-soars-the-sora21:05:31

Seems like that's my only issue, the :keyfn ... but it's hard to tell at casual glance on a recursive thang.

sova-soars-the-sora21:05:49

And my two reader methods look like...