MCPcopy
hub / github.com/pmndrs/react-spring / stopAsync

Function stopAsync

packages/core/src/runAsync.ts:199–205  ·  view source on GitHub ↗
(state: RunAsyncState, cancelId?: number | Falsy)

Source from the content-addressed store, hash-verified

197
198/** Stop the current `runAsync` call with `finished: false` (or with `cancelled: true` when `cancelId` is defined) */
199export function stopAsync(state: RunAsyncState, cancelId?: number | Falsy) {
200 flush(state.timeouts, t => t.cancel())
201 state.pauseQueue.clear()
202 state.resumeQueue.clear()
203 state.asyncId = state.asyncTo = state.promise = undefined
204 if (cancelId) state.cancelId = cancelId
205}
206
207/** This error is thrown to signal an interrupted async animation. */
208export class BailSignal extends Error {

Callers 4

stopMethod · 0.90
startFunction · 0.90
stopMethod · 0.90
animateFunction · 0.85

Calls 2

flushFunction · 0.90
cancelMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…