Last active
October 3, 2020 20:39
-
-
Save wavejumper/6be511ddd6f884e468a5e771d6857461 to your computer and use it in GitHub Desktop.
s3 cljspad example
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
(require '[sandbox.reagent :refer [render]] | |
'[cljs.tools.reader.edn :as edn]) | |
(def s3-url | |
"https://s3.amazonaws.com/sandbox.cljsfiddle.net/1/cljspad.manifest.edn") | |
(defn massage-it [str] | |
(let [edn (edn/read-string str)] | |
(map :name (:sandbox/libraries edn)))) | |
(defn render-it [edn] | |
(prn edn) | |
(render [:pre [:code.language-clojure (pr-str edn)]])) | |
(-> (js/fetch s3-url) | |
(.then #(.text %)) | |
(.then (comp render-it massage-it))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment