export type ReactiveProps> = { props: T; update: (nextProps: T) => void; }; export function createReactiveProps>( initialProps: T, ): ReactiveProps { const props = $state({ ...initialProps }) as T; return { props, update(nextProps: T) { for (const key of Object.keys(props)) { if (!(key in nextProps)) { delete props[key]; } } Object.assign(props, nextProps); }, }; }