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

Method finish

packages/core/src/SpringValue.ts:427–444  ·  view source on GitHub ↗

Skip to the end of the current animation.

()

Source from the content-addressed store, hash-verified

425
426 /** Skip to the end of the current animation. */
427 finish() {
428 if (isAnimating(this)) {
429 const { to, config } = this.animation
430 raf.batchedUpdates(() => {
431 // Ensure the "onStart" and "onRest" props are called.
432 this._onStart()
433
434 // Jump to the goal value, except for decay animations
435 // which have an undefined goal value.
436 if (!config.decay) {
437 this._set(to, false)
438 }
439
440 this._stop()
441 })
442 }
443 return this
444 }
445
446 /** Push props into the pending queue. */
447 update(props: SpringUpdate<T>) {

Callers 3

_resumeMethod · 0.95
describeEventsFunction · 0.95
Controller.test.tsFile · 0.80

Calls 4

_onStartMethod · 0.95
_setMethod · 0.95
_stopMethod · 0.95
isAnimatingFunction · 0.90

Tested by 1

describeEventsFunction · 0.76