You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the section The track function of the doc, it says:
The first argument to track should be a named function, i.e not an anonymous one.
But after playing with it a bit, i find it works well with anonymous functions. And from the code, it seems track is storing the cached results in the reagReactionCache attribute of the tracked function object, which shall not preclude the usage of anonymous functions.
(deftypeTrack [f args ^:mutable reaction]
IDeref
(-deref [this]
(if-some [r reaction]
(-deref r)
(cached-reaction #(apply f args) f args this nil)))
(defn-cached-reaction [f ^clj o k ^clj obj destroy]
(let [m (.-reagReactionCache o)
m (if (nil? m) {} m)
r (m k nil)]
The text was updated successfully, but these errors were encountered:
In the section
The track function
of the doc, it says:But after playing with it a bit, i find it works well with anonymous functions. And from the code, it seems track is storing the cached results in the
reagReactionCache
attribute of the tracked function object, which shall not preclude the usage of anonymous functions.The text was updated successfully, but these errors were encountered: