Hacker News new | past | comments | ask | show | jobs | submit login

I don't think I understand signals. What's reactive about them? I have to wrap every primitive in a custom object and I have to call setters for every primitive and I also have to define a function for computing derived values. None of this is reactive, these are just React hooks with 3x noisier code. The examples in the page imply you don't have to write dependency arrays. These were never a painpoint for me, but per their RFC:

> It is possible to, optionally, specify an equality comparator function. If the equality function determines that 2 values are equal, and if not equal, writable signal implementation will block update of signal’s value and skip change propagation. The default equality function compares primitive values (numbers, strings, etc) using === semantics but treats objects and arrays as “always unequal”.

So just like React, optimization is opt-in, but worse -- React transitioned from `shouldComponentUpdate` to dependency arrays for a reason. Hell, Python devs learned this lesson 15 years ago with the transition from comparison functions to `key` lambdas.

What am I missing?

Sidenote: the second sentence from that quote made my head spin. I've read it three times and still not sure if it's a mistake




I think I also don't understand signals. I expected something like signals/slots but this is something different. I read the example a few times to see if I was missing something, but I don't understand how this idiom fits into the larger picture of writing a component. What problem does it solve?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: