Solid · Partial values

Structural sharing

Every change produces a new value that reuses the objects of its unchanged parts instead of copying them. Reference equality (===) therefore shows whether a part changed, at the same cost for a reply of any size, and a renderer can skip what it has already rendered.

Schema
z.object({
  member: z.object({ name: z.string(), pass: z.string() }),
  seats: z.array(z.string()),
  why: z.string(),
})
Chunks
[
  '{"member":{"name":"Grace","pass":"season"},"seats":["C4","C5"],"why":"Near',
  ' the aisle."}',
]
Value after chunk 1 vs chunk 2
first === second
first.member === second.member
first.seats === second.seats
first.why === second.why
Output
[false, true, true, false]
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.