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
I looked into this, but I'm not sure if this makes sense.
Track doesn't really have a current value that could be watched. Track is backed by a Reaction, that does have a value, and Reactions have IWatchable implemented but I'm not completely sure how or when it works.
Seems like in case of reagent.core/track the Reaction value is only updated when the Track is deref'd. Otherwise, it is not following the dependencies and automatically updating the internal state. Thus the watch is not triggered without calling deref.
track! should start auto-running the reaction, so I think it keeps the internal state up to date. track! also returns the Reaction object, which can be watched.
@Deraen Thanks for looking into it, and for all the work you do. I have since moved onto using track! instead of patching Track to make track watchable.
My use case included being able to use the same code for a reactive derefable within a reagent context as watched on toplevel.
The
Track
type could benefit from being watchable by implementing theIWatchable
protocol.reagent/src/reagent/ratom.cljs
Line 216 in 4decfa6
reagent/src/reagent/ratom.cljs
Lines 174 to 177 in 4decfa6
The text was updated successfully, but these errors were encountered: