Skip to content

Commit

Permalink
Fix ordered-map-reader-cljs
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Oct 19, 2024
1 parent d41f8a3 commit d8b0650
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nextjournal/clerk/viewer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@
(.write w (if-let [opts (not-empty (dissoc (into {} v) :f :form))]
(str "#viewer-fn+opts " [opts (:form v)])
(str "#viewer-fn " (:form v))))))
#?(:cljs
(defn ordered-map-reader-cljs [coll]
(omap/ordered-map (vec coll))))

(def data-readers
{'viewer-fn ->viewer-fn
'viewer-fn+opts ->viewer-fn+opts
'clerk/unreadble-edn eval
'ordered/map #?(:clj omap/ordered-map-reader-clj
:cljs omap/ordered-map-reader-cljs)})
:cljs ordered-map-reader-cljs)})

#_(binding [*data-readers* {'viewer-fn ->viewer-fn}]
(read-string (pr-str (->viewer-fn '(fn [x] x)))))
Expand Down

0 comments on commit d8b0650

Please sign in to comment.