Skip to content

Instantly share code, notes, and snippets.

@viksit
Created October 8, 2014 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viksit/106822bdacd7e1d41ec0 to your computer and use it in GitHub Desktop.
Save viksit/106822bdacd7e1d41ec0 to your computer and use it in GitHub Desktop.
(defn get-posts-content [posts-data]
(do
(.log js/console "Posts data -> " posts-data)
(prn posts-data)
(prn "Type: " (type posts-data))
;; (prn (aget posts-data "msg"))
(let [a (js->clj posts-data)]
(prn "After conversion, type: " (type a)))
(prn (get a "msg"))
nil))
Posts data -> Object {success: "true", msg: "Successfully executed function", result: Object}
#js {:success "true", :msg "Successfully executed function", :result #js {:posts #js [#js {:tags "foo,bar", :username "viksit", :timestamp "2014-10-03T17:11:25Z", :content "tons of text here", :title "great tite", :url "http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac", :id "1dccce9e-2c82-4502-bec6-038ec278e2a9"}
Type: " #<function Object() { [native code] }>
"After conversion, type: " cljs.core/PersistentArrayMap
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment