# ClojureScript
- Reactivity comes from The change could come from a deref’ed atom, the arguments passed to the component or component state.
# Shadow-cljs vs Figwheel
Shadow-cljs (the compiler) provides for hot-reloading,
Use react with
- reagent
- re-frame for SPA
What is
^
carat sign in cljs?
^
is "the meta character" it tells the reader to add the symbol starting with ^
as metadata to the next symbol (provided it is something that implements IMetas)
;; Clojure code
(ns my.namespace)
;; print using JS console
(def my-js-obj #js{:foo "bar"}) ;; var my_js_obj = {foo: 'bar'};
(.log js/console my-js-object) ;; console.log(my_js_object);
;; => {foo: 'bar'}
;; JS-callable function
(defn ^:export add [a b] ;; function add(a, b) {
(+ a b)) ;; return a + b;
;; }
# Resources
← Clojure Collections →