I stumbled upon the official Om example under "examples/mixins", there's a definition as this:
(def MyComponent (let [obj (om/specify-state-methods! (clj->js om/pure-methods))]
(aset obj "mixins" #js [TestMixin])
(js/React.createClass obj)))
What does "#js" mean? I couldn't find any Clojure documentation on symbol "#" when it's used in this way.
From the Om tutorial:
#js {...}
and#js [...]
is what is referred to as a reader literal. ClojureScript supports data literals for JavaScript via#js
.#js {...}
is for JavaScript objects:
#js {:foo "bar"} ;; is equivalent to
#js {"foo" "bar"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With