This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-03
Channels
- # announcements (2)
- # babashka (154)
- # beginners (63)
- # calva (4)
- # cider (2)
- # clara (19)
- # clj-kondo (94)
- # cljfx (8)
- # cljs-dev (6)
- # clojars (2)
- # clojure (82)
- # clojure-australia (1)
- # clojure-europe (134)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-serbia (11)
- # clojure-taiwan (1)
- # clojure-uk (39)
- # clojurescript (83)
- # community-development (108)
- # conjure (10)
- # cursive (32)
- # data-oriented-programming (1)
- # datomic (22)
- # defnpodcast (9)
- # depstar (4)
- # docker (3)
- # events (3)
- # figwheel-main (2)
- # funcool (9)
- # graalvm (19)
- # honeysql (23)
- # jackdaw (4)
- # jobs (4)
- # jobs-discuss (2)
- # kaocha (24)
- # leiningen (1)
- # lsp (12)
- # membrane (6)
- # off-topic (21)
- # pathom (13)
- # polylith (1)
- # releases (7)
- # remote-jobs (2)
- # reveal (8)
- # ring (7)
- # sci (2)
- # shadow-cljs (9)
- # sql (10)
- # tools-deps (21)
Thank you for the responses, I'll check out your suggestions. To clear things up, I have a setup like this:
(def *state
(atom
(fx/create-context
{:some-other-stuff "some-values"
:progress 0}
cache/lru-cache-factory)))
(defmethod event-handler ::do-some-stuff [{:keys [fx/context]}]
(let [src (fx/sub-ctx context subs/source-folder)
dest (fx/sub-ctx context subs/dest-folder)])
(do
;;
;;I would like this function to update :progress every time it copies a single file
(some-namespace/copy-all-files-recursively source dest)
;;
;;
;;when it all finishes
{:context (fx/swap-context context
assoc
:progress
1.0)}))
That’s easier to do with a custom effect. effects receive a function that can be called to dispatch new events