This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-19
Channels
- # announcements (5)
- # beginners (36)
- # calva (2)
- # cider (26)
- # cljs-dev (2)
- # clojure (121)
- # clojure-spec (2)
- # clojure-uk (2)
- # clojurescript (12)
- # component (1)
- # conjure (6)
- # datomic (9)
- # docker (1)
- # fulcro (15)
- # lambdaisland (1)
- # malli (5)
- # meander (24)
- # off-topic (5)
- # re-frame (5)
- # reagent (3)
- # ring (3)
- # shadow-cljs (41)
- # sql (4)
- # vim (3)
- # xtdb (7)
I'm experimenting with multiple connections for every client 👀 thanks to the #105 issue forcing me to think about the concept and how I could slot it in seamlessly.
Adding a dynamic var system to handle binding things other than the current client in call stacks too! So small! And tested!
(module conjure.dynamic
{require {a conjure.aniseed.core}})
(def- stack-key :conjure.dynamic/stack)
(defn new [base-value]
(let [stack [base-value]]
(fn [x ...]
(if (= stack-key x)
stack
((a.last stack) x ...)))))
(defn- run-binds! [f binds]
(a.map-indexed
(fn [[dyn new-value]]
(f (dyn stack-key) new-value))
binds))
(defn bind [binds f ...]
(run-binds! table.insert binds)
(let [(ok? result) (pcall f ...)]
(run-binds! #(table.remove $1) binds)
(if ok?
result
(error result))))
Really happy with it, it means I can replace the current conjure.client/with-filetype
implementation with something robust, nestable and generic.
These are all internal things but really good progress towards having as many connections as you want per client with easy ways to switch between them 😄