Created
July 24, 2017 16:50
-
-
Save spinningtopsofdoom/aa796c0eecd1044a81b6d025658ff20c to your computer and use it in GitHub Desktop.
Convert Dom / Event Object to ClojureScript Map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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