File tree 2 files changed +17
-3
lines changed
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 386
386
387
387
(defn -applying [f]
388
388
(fn [_ children options]
389
- [(clojure.core/update children 0 #(m/schema % options))
390
- (clojure.core/update children 0 #(m/form % options))
391
- (delay (apply f (conj children options)))]))
389
+ (let [children (clojure.core/update children 0 m/schema options)]
390
+ [children
391
+ (clojure.core/update children 0 m/-form)
392
+ (delay (if (= 2 (count children))
393
+ (f (nth children 0 ) (nth children 1 ) options)
394
+ (apply f (conj children options))))])))
392
395
393
396
(defn -util-schema [m] (m/-proxy-schema m))
394
397
Original file line number Diff line number Diff line change 1133
1133
#?(:clj Exception, :cljs js/Error)
1134
1134
#":malli\. core/child-error"
1135
1135
(m/schema :union {:registry (merge (mu/schemas ) (m/default-schemas ))}))))
1136
+
1137
+ (deftest -applying-test
1138
+ (let [times-initialized (atom 0 )
1139
+ map-proxy (m/-proxy-schema
1140
+ {:type ::map-proxy
1141
+ :max 0
1142
+ :fn (fn [_ _ _]
1143
+ (swap! times-initialized inc)
1144
+ [[] [] (m/schema :map )])})]
1145
+ (m/deref-all (m/schema [:select-keys map-proxy []] {:registry (merge (mu/schemas ) (m/default-schemas ))}))
1146
+ (is (= 1 @times-initialized))))
You can’t perform that action at this time.
0 commit comments