export const Child = component$(() => {
const state = useStore({
count: 0
});
// Double count watch
useClientEffect$(() => {
const timer = setInterval(() => {
state.count++;
}, 1000);
return () => {
clearInterval(timer);
}
});
return (
<div>
{state.count}
</div>
);
});