Vue: Sets/Maps/WeakSets/WeakMaps (collections) are not reactive.

Created on 11 Oct 2017  ·  2Comments  ·  Source: vuejs/vue

Version

2.4.4

Reproduction link

https://jsfiddle.net/z93jk3py/

Steps to reproduce

Create computed value based on Set/Map/WeakSet/WeakMap. update collection, computed value not updated

What is expected?

Expect View to be updated on collection update

What is actually happening?

View not updated.


If not mistaken, development has been done to wrap Arrays methods (pop, push..). Should same be done for methods of aforementioned collections?

Most helpful comment

Ah, found it: https://github.com/vuejs/vue/issues/1319#issuecomment-162742130 (thanks to https://github.com/vuejs/vue/issues/5241#issuecomment-288057627)
Just to be clear, it's something that we plan to add on a future version 🙂

All 2 comments

Most of those collections not being supported by all browsers we cannot support them yet. I thought this was discussed in another issue but I couldn't find it.
In any case, this is something that will be added to v3 when we drop support for older browsers (https://github.com/vuejs/vue/issues/5893#issuecomment-308925671)

Ah, found it: https://github.com/vuejs/vue/issues/1319#issuecomment-162742130 (thanks to https://github.com/vuejs/vue/issues/5241#issuecomment-288057627)
Just to be clear, it's something that we plan to add on a future version 🙂

Was this page helpful?
0 / 5 - 0 ratings