This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-16
Channels
- # announcements (9)
- # babashka (12)
- # beginners (60)
- # biff (2)
- # calva (4)
- # cider (4)
- # clj-commons (1)
- # clj-kondo (17)
- # clojure (2)
- # clojure-europe (17)
- # clojurescript (15)
- # emacs (18)
- # exercism (5)
- # fulcro (15)
- # holy-lambda (13)
- # joyride (1)
- # lambdaisland (2)
- # malli (1)
- # nbb (3)
- # off-topic (23)
- # polylith (6)
- # portal (59)
- # releases (1)
- # squint (1)
- # tools-deps (4)
What does ^js
mean, as in https://github.com/macchiato-framework/macchiato-core/blob/master/src/macchiato/server.cljs#L32
The maintainer of this site added these recently: https://cljs.github.io/api/syntax/#js-tag https://cljs.github.io/api/syntax/js-tag https://cljs.github.io/api/syntax/meta
look up externs inference in CLJS. it tells the compiler that the returned object is a JS object that'll require externs to be generated, which prevent renaming by :advanced
optimizations
How to use re-frame-10x? I followed along with https://github.com/day8/re-frame-template using the +10x option and, browsing localhost:8280, I see the "hello from re-frame" message, so I know that the app-db is {:name "re-frame"} and that the initialize-db event fired. But, in the 10x panel at right, I do not see any events, even though the template used fn-traced for initialize-db. @hen I add a [:name] path inspector it comes up nil instead of showing the value the web page got from the subscription. The subs tab says "There are no subscriptions to show."
Noobie question. Is it possible to redefine a cljs function in another namespace? E.g.
(:require [com.something :as something])
(set! something/hello (fn [] (println "new hello!"))
Will other callers pick up this new definition? If they have already loading the original definition?that will work for single-arity functions, if you have multi-arities or varargs the compiler emits multiple js functions
i just implemented this for malli instrumentation if you want to see how to go about it
and a version using macros which is now deprecated, but for reference: https://github.com/metosin/malli/blob/f1c75baaffd5d009c7cab916ac4a8247bbb088df/src/malli/instrument/cljs.clj#L158
try pasting in some functions to see:
(defn hello [] (println "hi"))
(defn hi [& args] (println "args" args))
Taking a 👀 thanks!
Yeah this is multi-arity in this case
Probably best to avoid patching & just fork if need be