https://github.com/mfikes/cljs-bean

Like clojure.core/bean, but for ClojureScript.


(require '[cljs-bean.core :refer [bean]])

(bean #js {:a 1, :b 2})
;; => {:a 1, :b 2}


This lets you interoperate with JavaScript objects in an idiomatic fashion, 
while being an order of 
magnitude faster than equivalent constructs using js->clj:


(let [{:keys [a b]} (bean #js {:a 1, :b 2})]
  (+ a b))


-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojurescript/9125f5a8-71cd-4480-bd97-c66442222d2b%40googlegroups.com.

Reply via email to