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 on-the-client | |
(:require [cognitect.transit :as transit])) | |
;; Let's imagine the server has written the transit payload into this tag: | |
;; <script type="application/json" id="my-app-data">...</script> | |
;; This will output the original clojure data | |
(->> (js/document.getElementById "my-app-data") | |
.-innerHTML | |
(transit/read (transit/reader :json))) |
OlderNewer