This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-04
Channels
- # announcements (1)
- # asami (61)
- # babashka (71)
- # beginners (170)
- # biff (1)
- # calva (14)
- # clj-kondo (23)
- # cljsrn (28)
- # clojars (1)
- # clojure (152)
- # clojure-australia (2)
- # clojure-europe (65)
- # clojure-nl (2)
- # clojure-spec (8)
- # clojure-sweden (3)
- # clojure-uk (45)
- # clojurescript (1)
- # css (12)
- # cursive (16)
- # datomic (9)
- # devcards (2)
- # emacs (1)
- # events (1)
- # graalvm (31)
- # honeysql (10)
- # jackdaw (2)
- # jobs (5)
- # lambdaisland (9)
- # lsp (4)
- # malli (11)
- # meander (43)
- # off-topic (6)
- # pathom (7)
- # polylith (1)
- # portal (14)
- # re-frame (7)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (6)
- # shadow-cljs (101)
- # specter (1)
- # tools-deps (26)
- # vim (9)
- # xtdb (2)
A small thing I noticed, when evaluating portal/open
Multiple methods in multimethod 'simple-dispatch' match dispatch value: class portal.runtime.jvm.client.Portal -> interface clojure.lang.IDeref and interface clojure.lang.IPersistentMap, and neither is preferred
I still don't understand why my https://github.com/djblue/portal/blob/master/src/portal/runtime/jvm/client.clj#L76-L77 method isn't preferred :thinking_face:, any ideas?
The main feature this supports is deref-ing the result of open to get the current selected value back into your runtime repl environment
I'm starting to add this to my user
/ cljs.user
namespaces
(def portal-instance nil)
(defn portal
"Open a Portal window and register a tap handler for it. The result can be
treated like an atom."
[]
(let [p (portal/open portal-instance)]
(set! portal-instance p)
(add-tap #'portal/submit)
p))
the clj version
(def portal-instance (atom nil))
(defn portal
"Open a Portal window and register a tap handler for it. The result can be
treated like an atom."
[]
(let [p ((jit portal.api/open) @portal-instance)]
(reset! portal-instance p)
(add-tap (jit portal.api/submit))
p))
(using the [jit macro](https://lambdaisland.com/blog/2019-12-11-advent-of-parens-11-integrant-in-practice))@U1G869VNV I had a better look, this is coming from clojure.pprint/simple-dispatch
, not from print-method
...
you might be interested in https://github.com/lambdaisland/data-printers , even if only for inspiration. There are multiple print implementations across clj/cljs to reckon with