Skip to content

Instantly share code, notes, and snippets.

@wavejumper
Last active October 3, 2020 20:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save wavejumper/6be511ddd6f884e468a5e771d6857461 to your computer and use it in GitHub Desktop.
s3 cljspad example
(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