This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-18
Channels
- # aleph (1)
- # announcements (31)
- # babashka (9)
- # babashka-sci-dev (36)
- # beginners (72)
- # calva (20)
- # clj-kondo (99)
- # cljsrn (1)
- # clojure (77)
- # clojure-europe (33)
- # clojure-nl (4)
- # clojure-norway (12)
- # clojure-uk (4)
- # clojurescript (23)
- # cursive (2)
- # datascript (5)
- # events (1)
- # fulcro (3)
- # honeysql (3)
- # inf-clojure (82)
- # interop (2)
- # kaocha (10)
- # lsp (15)
- # meander (1)
- # missionary (10)
- # off-topic (22)
- # pathom (4)
- # pedestal (3)
- # polylith (20)
- # re-frame (10)
- # react (4)
- # reagent (4)
- # reitit (27)
- # ring-swagger (1)
- # shadow-cljs (34)
- # specter (3)
- # sql (1)
- # testing (5)
- # tools-deps (22)
- # vim (12)
Is there any way to know that the flow has been closed and there will be no more items in the stream?
let's say I'd like to display a spinner from the start of the data download until the end.
(defn some-random-flow []
(let [xs (vec (range (rand-int 1000)))]
(mi/seed xs)))
(defn some-fn []
(mi/ap
(show-spinner)
(let [x (mi/?> (some-random-flow))]
<<some body>>)
(hide-spinner)))
I am currently doing something like this, but it does not look idiomatic
(defn some-fn []
(mi/ap
(show-spinner)
(loop [[x & more] (mi/reduce conj (some-random-flow))]
<<loop body>>)
(hide-spinner)))
@U053XQP4S rxjs has something like this https://www.learnrxjs.io/learn-rxjs/operators/utility/finalize