Skip to content

Commit

Permalink
fix cljs-memoize
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Jan 26, 2021
1 parent 2f15a96 commit e58c8e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
borkdude/sci {:git/url "https://github.com/borkdude/sci.git"
:sha "b310358cd41f761d7bbd50227a36d1160938ce71"}
prismatic/schema {:mvn/version "1.1.12"}
minimallist/minimallist {:mvn/version "0.0.10"}
meta-merge/meta-merge {:mvn/version "1.0.0"}
org.clojure/spec-alpha2 {:git/url "https://github.com/clojure/spec-alpha2.git"
:sha "8498f9cb352135579b6d3a0a5d15c40e5c2647ce"}}}
Expand Down
2 changes: 1 addition & 1 deletion src/malli/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

(defn -memoize [f]
(let [value #?(:clj (AtomicReference. nil), :cljs (atom nil))]
(fn [] #?(:clj (or (.get value) (do (.set value (f)) (.get value))), :cljs (or @value) (reset! value (f))))))
(fn [] #?(:clj (or (.get value) (do (.set value (f)) (.get value))), :cljs (or @value (reset! value (f)))))))

(defn -inner-indexed [walker path children options]
(mapv (fn [[i c]] (-inner walker c (conj path i) options)) (map-indexed vector children)))
Expand Down

0 comments on commit e58c8e8

Please sign in to comment.