News for hackers. Stuff that matters.
Re:Solid.js feels like what I always wanted React to be by robertoandred on Tuesday March 01, 2022 @12:31PM (#30517074)
Sure there is. Set the interval on mount, clear it on unmount:

  useEffect(() => {
    const interval = setInterval(() => {
      // whatever
    }, 1000)

    return () => {
      clearInterval(interval);
    }
  }, [])

There are no comments on this comment yet.