Ask questionsforce re-computation of a computed property
Is there a way to force re-computation of a computed property when none of the values the property depends on have changed?
I have a computed property that depends on some of the model data as well as the current time. So, the value of the computation changes over time. I'd like to force re-computation on an interval to capture the time dependency. Right now, I'm using a value on the root VM that is being toggled on an interval is a "dummy" dependency of the computed property. This works, but it seems like there should be a better solution.
Answer questions sirlancelot
but it would have been awesome to just call
@thedamon I created a
$recompute() solution a few comments up but personally I think your
storeActive is a better solution because it better describes your data model's dependencies. A
$recompute() method is imperative-driven and sort of against Vue's design goal.