4 ms·
For arrays, did you end up taking the diffing/memoization approach like solid? I've yet to see any framework have O(1) collection mutation reactivity.
by notnullorvoid 3y ago
For arrays, did you end up taking the diffing/memoization approach like solid?
I've yet to see any framework have O(1) collection mutation reactivity.
- recursive 3y agoThere's no diff. Arrays get proxies just like everything else. For mutations that change the length, extra elements are built or removed at the end. Assignment straight to an index (that doesn't change length) is able to use normal object property semantics. arr.push(e) and arr[i] = e are both O(1). But not all array operations achieve this.
- notnullorvoid 3y agoWow, took a look at the ForEach code to better understand. That's a very novel approach.
- recursive 3y agoI'm not too familiar with the state of the art, but I assumed this had been done before. I have some vague ideas about implementing efficient .splice() calls. Right now knowledge about splicing semantics is lost in between the proxy layer and `ForEach` DOM node array. But I have a bunch of other plans to do first.