feat(reactivity): expose last result for computed getter#9497
feat(reactivity): expose last result for computed getter#9497yyx990803 merged 1 commit intovuejs:minorfrom
Conversation
|
How much does redundant re-rendering affect performance compared to doing a (sometimes really heavy)
I don't think it's wise to provide an |
|
I'll keep this in mind when we update the docs for 3.4. |
|
I have some concerns about this addition. Given this PR has already been merged into |
computedinternally usesObject.isto compare whether the old and new values have changed. This is valid for primitives, but cannot compare objects (this is the correct behavior).We can expose the
computedlast value for getter, so the user can decide whether to return the last value for object to passObject.is.Another alternative is to provide
isEqualoption, but I don't recommend this approach. This requires always fully executing the getter and returning a new object, which I think limits performance and GC pitfalls that the user should be able to avoid.isEqualthat needs to GC