Skip to main content

Backend event stop

External events can call cancel(reason) without involving timer schedules.

Backend event stopLive

External event

Listening
idle
TransportWebSocket/SSE
Local stateidle
Actioncancel(reason)
useEffect(() => {
return subscribeToAuction(auctionId, event => {
if (event.type === 'auction:sold') timer.cancel('sold');
});
}, [auctionId, timer.cancel]);