Hacker News new | ask | show | jobs
by mwcampbell 1577 days ago
How does Solid avoid the need for user-provided keys? I thought it also had to diff the underlying array. Does it check object identity?
1 comments

It does. Just referential check. Our reactivity is nested and we don't want blow out everything so even though there is read/write segregation and immutable interfaces the internals are mutable. In so sorting looks at referential equality, and nested updates don't even trigger list diffing.

Now this does require special process for intaking immutable or big data snapshots where we can't do reference comparison. So we do have a data diffing capability in our nested reactive stores to propagate only what changes. But for the most part common actions like partial updates highly optimized. As well as simple list operations like sorting.