This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-25
Channels
- # babashka (9)
- # beginners (56)
- # calva (18)
- # clj-kondo (2)
- # clojars (2)
- # clojure (46)
- # clojure-boston (1)
- # clojure-europe (4)
- # clojurescript (10)
- # css (1)
- # data-science (2)
- # emacs (10)
- # girouette (1)
- # helix (10)
- # jobs-discuss (4)
- # malli (2)
- # off-topic (28)
- # polylith (5)
- # re-frame (4)
- # reitit (8)
- # releases (6)
- # rewrite-clj (1)
- # sci (44)
- # sql (10)
- # tools-deps (31)
I have a bizarre problem with callback hell, despite using async-flow
Let's say I have an event ::fetch-from-x
that takes an argument and ::fetch-from-y
that also takes an argument, plus y
needs data stored by x
.
When processing [::fetch-from-y "bar"]
, I check if I have the needed data in the db
and if I don't, then:
{:fx [[:async-flow
{first-dispatch [::fetch-from-x "foo"]
:rules [{:when :seen?
:events ::fetch-from-x-success
:dispatch [::fetch-y "bar"]
:halt? true}]}]]}
if I call ::fetch-from-y
several times with different arguments, async-flow
does not allow to check witch ::fetch-from-x
event succeeded 😞@U0BBFDED7 https://github.com/day8/re-frame-async-flow-fx#under-the-covers async-flow keeps track of events that have already ran. With this design it only allows each rule to be run once Someone also https://github.com/day8/re-frame-async-flow-fx/issues/15 to track something similar to what you’re looking to do