om

Please ask the channel first, not @dnolen directly!
2018-06-07T07:01:34.000077Z

My first thought would be to return an id for reading the result in the future. Then you could customize your merge fn to recognize there are asynchronous results and start polling.

2018-06-07T07:03:43.000151Z

It's definitely possible, but I don't know of any examples.

Adam Bubeníček 2018-06-07T08:37:30.000559Z

Interesting, why do you think merging would be necessary? I thought no outside state needs to be involved, just the final tree of data composed by a recursive parser.

Adam Bubeníček 2018-06-07T08:41:03.000371Z

You gave me an idea though, what if :read fn returns {:value async-channel-with-val}, and then I just wrap parser function to loop through map values, see if they are channels and wait for their resolution (and return channel itself). In theory that could work recursively too. Not very good with core.async yet, but I’ll try to put it together

2018-06-07T09:52:24.000043Z

The final tree of data will not be final in your case, it will contain placeholders for things that appear later

2018-06-07T09:53:41.000528Z

You'll need a way to trigger a re-read on components after the data is available, which is where merge comes in

wilkerlucio 2018-06-07T13:36:43.000726Z

@adambubenicek pathom has full async support if you need it, so I think can get a good head start there

👍 2
2018-06-07T14:23:19.000900Z

Indeed, I was describing a different kind of async, if waiting isn't an option

wilkerlucio 2018-06-07T14:29:51.000509Z

I just don't recommend using pathom as your client parser (the one that runs in the reconciler, the base parser) because it probably will be slow for that, pathom is more focused on remote parsers (that can serve your 'sends' from local, or on the server, node.js or clojure)

👍 1
Adam Bubeníček 2018-06-07T14:36:18.000136Z

Pathom does look very good. Frankly, I wanted to start with something smaller and simpler (om next appears to be), mainly to learn. But in the end I probably should use Pathom (+ Fulcro). Thanks!

👍 1
wilkerlucio 2018-06-07T17:22:53.000152Z

@adambubenicek to be honest, I think Fulcro is simpler than Om.next, it can look scary on the outside because it seems like "more stuff", but it gets you ahead in a lot of things that require manual implementation in om.next, like the local parser

🙂 4