vuejs doesn't support Sets as backing fields for binding (nor maps, weakmap, weakset reactivity)

Created on 21 Mar 2017  路  6Comments  路  Source: vuejs/vue

Version

2.2.4

Reproduction link

https://github.com/amgadserry/vuejs-issue-sets or
https://jsfiddle.net/zab31wxz/1/

Steps to reproduce

click on the grey square

What is expected?

each click should switch text between true and false

What is actually happening?

it doesn't change text

Most helpful comment

as explained by Evan in this https://github.com/vuejs/vue/issues/1319#issuecomment-162742130, we don't see the benefits big enough to justify the big changes that it would require, especially as long as native support is lacking (read: IE is still a supported platform, and Android also hasn't implemented Sets yet).

Also, the problem of not being serializable is something that I don't see going away anytime soon - but that's something all store solutions will have to take into account when thinking about persistence (localStorage ...)

That being said, I think it will be added some time in the future, but currently, it's not on our immediate todo-list.

All 6 comments

Could you create repro on jsfiddle/codepen?

Yes, you can't use Sets or Maps in reactive data currently. See as a related issue: #2410

@LinusBorg is there any intentions of supporting such data types in the future ?

as explained by Evan in this https://github.com/vuejs/vue/issues/1319#issuecomment-162742130, we don't see the benefits big enough to justify the big changes that it would require, especially as long as native support is lacking (read: IE is still a supported platform, and Android also hasn't implemented Sets yet).

Also, the problem of not being serializable is something that I don't see going away anytime soon - but that's something all store solutions will have to take into account when thinking about persistence (localStorage ...)

That being said, I think it will be added some time in the future, but currently, it's not on our immediate todo-list.

@LinusBorg okay then gonna close the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdedardel picture bdedardel  路  3Comments

finico picture finico  路  3Comments

paceband picture paceband  路  3Comments

franciscolourenco picture franciscolourenco  路  3Comments

seemsindie picture seemsindie  路  3Comments