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
"isComputedLazy": "Does the asyncComputed property have the 'lazy' property?
"isLazyActive": "Is the [lazy] property set to true?
If both above are true, then it does return nonLazy.call(this).
Note the last step. That seems backwards. Shouldn't it be return silentGetLazy(this, key), if this is a [lazy] property, and set to active?
In my .vue file I have a simple asyncComputed property with lazy: true, and a console.log within it's getter. The console.log fires whenever a referenced property updates, even though lazy is set to true.
When looking at the console.log output for this, it shows async_computed$lazy_active$CallRecordingInfo: true and async_computed$lazy_data$CallRecordingInfo: Object.
Am I missing something?
The text was updated successfully, but these errors were encountered:
I forked the repo and swapped the results of that IF statement to reverse them. This accomplished two things:
Correctly only called the getter when I called .update()
Weirdly did NOT save the results into async_computed$lazy_data$CallRecordingInfo when resolved.
Rather than mess around and set async_computed$lazy_data$CallRecordingInfo manually each time, I figured I'd run clean and swap back to a normal data() property and update it manually.
But I'm still curious: Am I using lazy: true correctly in the code above? Is my expectation correct that lazy getters SHOULD NOT FIRE when referenced properties (this.Call in the above example) change?
I think this line is to blame:
vue-async-computed/src/index.js
Line 160 in 71020d6
Logic goes like this:
return nonLazy.call(this)
.Note the last step. That seems backwards. Shouldn't it be
return silentGetLazy(this, key)
, if this is a [lazy] property, and set to active?In my .vue file I have a simple asyncComputed property with lazy: true, and a console.log within it's getter. The console.log fires whenever a referenced property updates, even though lazy is set to true.
When looking at the console.log output for
this
, it showsasync_computed$lazy_active$CallRecordingInfo: true
andasync_computed$lazy_data$CallRecordingInfo: Object
.Am I missing something?
The text was updated successfully, but these errors were encountered: