const $set: <T>($set: T) => Update<T>
Set or replace a value without merging.
import { $set } from "@use-gpu/state";
const value = {
hello: {text: 'world', bar: 2},
foo: 1,
};
const update = {
hello: $set({text: 'test'}),
};
expect(patch(value, update)).toEqual({
hello: {text: 'test'},
foo: 1,
});
packages / state / src / patch.ts