Fork me on GitHub
#architecture
<
2020-11-25
>
athomasoriginal01:11:01

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

👍 3
walterl13:11:19

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

athomasoriginal13:11:55

That’s a fair point, @UJY23QLS1 - 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?)

walterl14:11:05

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.

drewverlee03:11:41

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

athomasoriginal00:11:13

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

drewverlee00:11:36

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

drewverlee00:11:58

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

drewverlee00:11:36

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).

athomasoriginal02:11:35

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.

athomasoriginal02:11:35

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.)

drewverlee03:12:34

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