finsook
Reactivity not referentially transparent?
Right, but say you have:
Then you can run the render function
{id, a, b} => [id, <div>{a}+{b}</div>
and get
And then turn that into a DOM text modification using a diff algorithm.
And with a Sufficiently Smart Compiler you can skip the diff and compile the render function directly into an incremental DOM update function
63 replies
Reactivity not referentially transparent?
there is https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/reconcile.js which looks like basically the same algorithm as For.
63 replies
Reactivity not referentially transparent?
hmm, so they both use ===: https://github.com/solidjs/solid/blob/c9049dc8ddb39fc2163082c7bde3f507eb1ce831/packages/solid/src/reactive/array.ts. I guess the difference is really that For has a diff algorithm type thing, whereas Index does a simple index-by-index check. In that sense Index does use the numeric index as a key.
63 replies