File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 3838 Note key-fn is only used for proxied ClojureScript maps. This
3939 function should map strings to the appropriate key
4040 representation. If unspecified, key-fn defaults to keyword. All maps
41- proxied from the same ctor fn will share the same key-fn cache."
41+ proxied from the same ctor fn will share the same key-fn cache.
42+
43+ A cache-fn may be suppled to override the default cache. This fn
44+ should take key-fn and return a memoized version."
4245 ([]
4346 (builder keyword))
4447 ([key-fn]
48+ (builder keyword write-through))
49+ ([key-fn cache-fn]
4550 (js* " var __ctor" )
46- (let [cache-key-fn (write-through key-fn)
51+ (let [cache-key-fn (cache-fn key-fn)
4752 vec-handler #js {:get (fn [^cljs.core/IIndexed target prop receiver]
4853 (cond
4954 (identical? " length" prop)
106111 :else target))]
107112 __ctor)))
108113
114+ (def ^{:doc " Default proxy for maps and vectors." }
115+ proxy (builder ))
116+
109117(comment
110118
111119 (def c (SimpleCache. #js {} 0 ))
You can’t perform that action at this time.
0 commit comments