diff --git a/content/3-lifecycle/2-on-unmount/qwik/Time.tsx b/content/3-lifecycle/2-on-unmount/qwik/Time.tsx index 0e6ec3ea..6de0c812 100644 --- a/content/3-lifecycle/2-on-unmount/qwik/Time.tsx +++ b/content/3-lifecycle/2-on-unmount/qwik/Time.tsx @@ -5,12 +5,12 @@ export const App = component$(() => { time: new Date().toLocaleTimeString(), }); - useVisibleTask$(() => { + useVisibleTask$(({ cleanup }) => { const timer = setInterval(() => { store.time = new Date().toLocaleTimeString(); }, 1000); - return () => clearInterval(timer); + cleanup(() => clearInterval(timer)); }); return
Current time: {store.time}
;