(def transit-read-opts
(try
(require '[cognitect.transit])
(when-some [ns (find-ns 'cognitect.transit)]
(let [read-handler @(ns-resolve ns 'read-handler)
read-handler-map @(ns-resolve ns 'read-handler-map)]
{:handlers
(read-handler-map
{"cljs/js" (read-handler (fn [v] (JSValue. v)))
"cljs/regex" (read-handler (fn [v] (Pattern/compile v)))})}))
(catch Throwable t
nil)))