This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-02
Channels
- # aleph (1)
- # announcements (1)
- # babashka (4)
- # beginners (89)
- # calva (3)
- # chlorine-clover (18)
- # cider (33)
- # clj-kondo (27)
- # cljdoc (4)
- # cljsrn (2)
- # clojure (248)
- # clojure-europe (7)
- # clojure-italy (15)
- # clojure-nl (7)
- # clojure-norway (10)
- # clojure-poland (1)
- # clojure-spec (12)
- # clojure-sweden (5)
- # clojure-uk (57)
- # clojured (4)
- # clojuredesign-podcast (1)
- # clojurescript (55)
- # core-async (14)
- # core-logic (3)
- # cursive (10)
- # datomic (38)
- # figwheel-main (8)
- # fulcro (23)
- # graalvm (126)
- # hoplon (59)
- # jobs (1)
- # kaocha (3)
- # malli (30)
- # meander (17)
- # off-topic (32)
- # pathom (19)
- # pedestal (4)
- # re-frame (12)
- # reagent (2)
- # reitit (3)
- # shadow-cljs (81)
- # sql (9)
- # tools-deps (34)
- # vim (20)
- # vscode (7)
- # xtdb (5)
(def halt-when-error-key
(halt-when :error
(fn [_result item]
(println "matching item: " item)
(assoc item :added :key))))
(transduce
halt-when-error-key
conj
[]
[{:error :foo}]) ;; => {:error :foo, :added :key}
(def pc (a/promise-chan
halt-when-error-key))
(a/take! pc (fn [res]
(println "got" res)))
(a/put! pc {:error :here})
;; output seen
;; matching item: {:error :here}
;; got nil
;; output expected
;; matching item: {:error :here}
;; got {:error :foo, :added :key}
Is there a way to get the behavior as under 'output expected'?@ghadi I see, then I had the wrong expectation for halt-when when used with a channel
Thanks for the help (I ran into this while listening to your latest cognicast, which I enjoyed)