This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-21
Channels
- # announcements (4)
- # aws (29)
- # aws-lambda (1)
- # babashka (21)
- # beginners (143)
- # calva (47)
- # cider (31)
- # clj-kondo (24)
- # cljsrn (4)
- # clojure (70)
- # clojure-australia (3)
- # clojure-czech (1)
- # clojure-europe (97)
- # clojure-greece (4)
- # clojure-nl (3)
- # clojure-uk (45)
- # clojurescript (70)
- # code-reviews (1)
- # conjure (7)
- # cursive (10)
- # datomic (13)
- # duct (5)
- # emacs (1)
- # fulcro (38)
- # graalvm (1)
- # graphql (9)
- # honeysql (13)
- # integrant (33)
- # jobs (14)
- # jobs-rus (1)
- # malli (7)
- # off-topic (72)
- # pathom (1)
- # re-frame (11)
- # reitit (9)
- # remote-jobs (2)
- # sci (11)
- # shadow-cljs (9)
- # sql (5)
- # tools-deps (5)
- # xtdb (6)
I've got a question about the best way to chain requests in re-frame land. I'm dealing with an api that requires multiple POSTs in sequence, with each one building on the result of the previous.
Is there a good pattern for this? Manually chaining together events seems a bit fragile
to elaborate:
I've got to create topic a
,
post message 1
to topic a
,
post message 2 referencing message 1
to topic b
Now, I've got a generic create-topic
event handler, and a generic send-message
event handler, as those are used all over the place.
And at each step I've got to hook in to the flow in a generic way to track requests, updating request status and loading spinners, etc.
So the chain of events is becoming quite long, and I worry that I'm going to have trouble figuring out how it all works in 6 months
And the thing that keeps poking me is that this can be done with ~10 lines of code with async/await
style js, and I'm not sure how to translate it.
I'm not confident enough to say that this is the best way, but I remember using https://github.com/day8/re-frame-async-flow-fx to achieve something similar