Skip to content

Instantly share code, notes, and snippets.

@spinningtopsofdoom
Created July 24, 2017 16:50
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 spinningtopsofdoom/aa796c0eecd1044a81b6d025658ff20c to your computer and use it in GitHub Desktop.
Save spinningtopsofdoom/aa796c0eecd1044a81b6d025658ff20c to your computer and use it in GitHub Desktop.
Convert Dom / Event Object to ClojureScript Map
(ns my-app.core
(:require [goog.object :as gobj]))
(defn js-obj->clj-map
"Uses the Google Closure object module to get the keys and values of any JavaScript Object
and put them into a ClojureScript map"
[obj]
(zipmap (gobj/getKeys obj) (gobj/getValues obj)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment