What does this "#" mean in this Clojure context?

I came across an official Om example in the "examples / mixins" section, there is a definition:

(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 could not find the Clojure documentation for the "#" symbol when it was used this way.

+4
source share
3 answers

From the Om tutorial :

#js {...}and #js [...]- this is what is called a reader literal. ClojureScript supports data literals for JavaScript through #js. #js {...}for JavaScript objects:

#js {:foo "bar"}  ;; is equivalent to
#js {"foo" "bar"}
+6
source

Om Clojurescript. Clojure Clojurescript, .

#js , edn, , , #js Javascript. .

+6

#. , , - , #js, # ( #_ # . , JavaScript.

: http://clojure.org/reader#The%20Reader--Macro%20characters

0

Source: https://habr.com/ru/post/1545517/


All Articles