v0.20.233 - 8.1 / 5.9

useTimeout

useTimeout is a helper to create a setTimeout that autodisposes. It also allows for the delay to be reactive. Provides start and stop functions for easily restarting the timeout.

# Using useTimeout

start() schedules the callback; stop() cancels it. When delay is a signal, writing to it restarts the pending timeout automatically. The timeout also cancels itself when the owning scope is disposed.