3 ms·
The .value thing is dreadful. Is it really necessary? I still prefer options API.
by euoia 2y ago
The .value thing is dreadful. Is it really necessary? I still prefer options API.
- lloydatkinson 2y agoIt really is awful and smells of leaky abstraction. Now that this is the recommended way of writing Vue, I’d be really interested in your opinion on React. Compare the “ref” in Vue with useState hook in React. With the useState you get back two items: the value, and a setter. Now every time you access the value you simply access it like a variable because it is.
- rty32 2y ago[flagged]
- lloydatkinson 2y agoWhy are you under the pretence I don’t know the difference? I clearly know the difference. I’m discussing the ergonomics of the API and its resulting DX. Sigh, I wish people put some effort into actually reading the thing before posting opinions.
- rty32 2y agoThat's just how Proxy works in JavaScript. You might want to read a bit more about the underlying mechanism.