net.coruscation.js4clj.utils
clj->js
(clj->js obj)
Convert a Clojure value to a JavaScript one
`set`/`vector`/`list` -> JavaScript Array
`keyword`/symbol -> String
`map` -> JavaScript Object
js->clj
(js->clj value & {:keys [keywordize-keys], :or {keywordize-keys false}})
Recursively convert a JavaScript object to a Clojure value
With option {:keywordize-keys true} will convert object fields from strings to keywords.
Converting Table:
JavaScript Executable -> Clojure fn
JavaScript Array -> Clojure Vector
Any JavaScript Object not instantiable or executable -> Clojure Mapjs-set!
macro
(js-set! dot-form value)
(js-set! (js.- obj field) value)
(js-set! (js.. obj -field) value)
Set the property of a JavaScript object to `value`, the property is accessed with `js.-` or `js..` in the first parameter
js.
macro
(js. obj method & args)
(js. object method) => object.method()
Invoke `method` of the object `object`, like the builtin `.`
js.-
macro
(js.- obj field)
(js.- object field) => object.field
Access `field` of the object `object`, like the builtin `.-`
js..
macro
(js.. obj & args)
(js.. object -field1 -field2 method) => object.field1.field2.method()
Chained field access or method invoking of `object`, like the builtin `..`