Skip to content

Commit c2d19b4

Browse files
cjpillsburyclaude
andcommitted
fix(spf): resolve typecheck errors in machine.ts and track-playback-initiated test
Use function form of `update()` in `createMachineCore` transition to satisfy generic `Partial<Snapshot>` constraint. Omit `url` property instead of setting it to `undefined` to satisfy `exactOptionalPropertyTypes`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 26e9f80 commit c2d19b4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/spf/src/core/machine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ export function createMachineCore<FullState extends string, Snapshot extends Mac
4242
) {
4343
const snapshotSignal = signal(initialSnapshot);
4444
const getState = (): FullState => untrack(() => snapshotSignal.get().value);
45-
const transition = (to: FullState): void => update(snapshotSignal, { value: to });
45+
const transition = (to: FullState): void => update(snapshotSignal, (current) => ({ ...current, value: to }));
4646
return { snapshotSignal, getState, transition };
4747
}

packages/spf/src/dom/features/tests/track-playback-initiated.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('trackPlaybackInitiated', () => {
129129
await new Promise((resolve) => setTimeout(resolve, 10));
130130
expect(state.get().playbackInitiated).toBe(true);
131131

132-
state.set({ ...state.get(), presentation: { url: undefined } });
132+
state.set({ ...state.get(), presentation: {} });
133133
await new Promise((resolve) => setTimeout(resolve, 20));
134134

135135
expect(state.get().playbackInitiated).toBe(false);

0 commit comments

Comments
 (0)