How do I stop a createHeartbeat loop after a status check is done? #9
-
|
I want a small heartbeat while a status check is running. What should stop the interval and how can I inspect the last beat? |
Beta Was this translation helpful? Give feedback.
Answered by
shnwazdeveloper
May 10, 2026
Replies: 1 comment
-
|
Create it with |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
clyxudev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create it with
createHeartbeat({ interval, onBeat }), callstart()while the status check is active, then callstop()when the check finishes.stop()clears the interval and returnssnapshot()withrunning,count,startedAt,lastBeatAt, andinterval; listeners can useonBeat(handler)and keep the unsubscribe function.