MCPcopy
hub / github.com/Splidejs/splide / computeDestination

Function computeDestination

src/js/components/Drag/Drag.ts:298–303  ·  view source on GitHub ↗

* Computes the destination by the velocity and the `flickPower` option. * * @param velocity - The drag velocity. * * @return The destination.

( velocity: number )

Source from the content-addressed store, hash-verified

296 * @return The destination.
297 */
298 function computeDestination( velocity: number ): number {
299 return getPosition() + sign( velocity ) * min(
300 abs( velocity ) * ( options.flickPower || 600 ),
301 isFree ? Infinity : Components.Layout.listSize() * ( options.flickMaxPages || 1 )
302 );
303 }
304
305 /**
306 * Returns the coord difference between the provided and base events.

Callers 1

moveFunction · 0.85

Calls 3

signFunction · 0.90
getPositionFunction · 0.85
listSizeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…