const [state, setState] = createStore({ foo: { dummy: "a", count: 1 } });
const increment = () =>
setState(
reconcile(
{ foo: { dummy: "a", count: state.foo.count + 1 } },
{ merge: true },
),
);
const getDelta = captureStoreUpdates(state as any);
createEffect(() => {
const delta = getDelta();
// after an increment(), i'd expect to get:
// [{path: ["foo", "count"], value: 2}]
// but i get the entire reconciled value:
// [{path: ["foo"], value: {dummy: "a", count: 2}}]
console.log("delta:", delta);
});
const [state, setState] = createStore({ foo: { dummy: "a", count: 1 } });
const increment = () =>
setState(
reconcile(
{ foo: { dummy: "a", count: state.foo.count + 1 } },
{ merge: true },
),
);
const getDelta = captureStoreUpdates(state as any);
createEffect(() => {
const delta = getDelta();
// after an increment(), i'd expect to get:
// [{path: ["foo", "count"], value: 2}]
// but i get the entire reconciled value:
// [{path: ["foo"], value: {dummy: "a", count: 2}}]
console.log("delta:", delta);
});