architecture

athomasoriginal 2020-11-25T01:36:01.322300Z

HTTP Client API Question which might be better suited for this channel: https://clojurians.slack.com/archives/C053PTJE6/p1606266607071100

đź‘Ť 1
walterl 2020-11-25T13:40:19.322800Z

Why not both? Like HoneySQL's helpers that are V1-like (and easier to read), but ultimately produces and works on V2-like maps.

athomasoriginal 2020-11-25T13:46:55.323Z

That’s a fair point, @clojurians-slack100 - do have a preference of one over the other? (assuming both is on the table, which might you opt for if you were using such an library?)

walterl 2020-11-25T14:11:05.323300Z

Taking HoneySQL as a practical example, I generally use the helpers for simple cases, and maps for more complicated cases. I've even mixed the two on occasion.

2020-11-27T03:24:41.323700Z

Is there a chance callers might need more or less then the call back chain "then success fail"?

athomasoriginal 2020-11-28T00:31:13.324Z

@drewverlee are you suggesting that using version 2 a user might want to continue chaining?

2020-11-28T00:50:36.324300Z

Yes. It's obvious that's used in async callbacks, but I think it's used for further pipelining.

2020-11-28T00:50:58.324500Z

I don't know if your closing any doors they might need.

2020-11-28T00:53:36.324700Z

I think on the extreme end of composabilty, don't we end up with something like core async? I haven't thought about fetch in a minute, I recall it's an improvement over httpxml (or something).

athomasoriginal 2020-11-28T02:48:35.324900Z

That’s a good point. The way it would be implemented is that as long as the user continue to return they can continue to chain on their end.

athomasoriginal 2020-11-28T02:49:35.325100Z

As you alluded though, using this helper will not make as much sense if they use core.async. Still playing with that idea as none of this make as much sense in an async/await or core.async world (for future readers: i’m not suggesting we can use async/await in CLJS. I’m just using that as an example.)

2020-12-02T03:31:34.326100Z

@tkjone https://github.com/lambdaisland/fetch/ Is a lib that wraps fetch. It might be worth looking at the code for inspiration