vuejs / rfcs

RFCs for substantial changes / feature additions to Vue core
4.86k stars 548 forks source link

Do we really need ref API? #208

Closed yisar closed 4 years ago

yisar commented 4 years ago

It has to be said that ref and reactive are the biggest mental burden of composition API.

The existence of ref may be much worse than expected, because in terms of the mechanism of that, develops can create more and more ref-like APIs, which will only lead to worse and worse……

But if we constrain reactive API

  1. Must be an object or an array

  2. Must not be deconstructed

Doesn't seem to be a problem, either?

posva commented 4 years ago

Yes, we do. We cannot just have reactive, it would also force the usage of a property name on the reactive object like reactive({ value }). This has been extensively discussed before in the RFCs