Subscribe on changes!

expect(toRef(data, 'count') === toRef(data, 'count')).toBe(true)

avatar
Aug 18th 2021

What problem does this feature solve?

improve performance

What does the proposed API look like?

whether it is necessary? should I send a PR? thanks

avatar
Aug 18th 2021

This would require keeping track of all refs created with toRef() no matter where they come from, which could increase memory usage depending on libraries. In most cases, this shouldn't be a problem though.

If this really makes a difference in your application, you can still implement your own cached version with a weak map as a cache.