MCPcopy Create free account
hub / github.com/FormidableLabs/react-swipeable / getOrder

Function getOrder

examples/app/SimpleCarousel/Carousel.tsx:25–27  ·  view source on GitHub ↗
(index: number, pos: number, numItems: number)

Source from the content-addressed store, hash-verified

23 | { type: 'stopSliding' };
24
25const getOrder = (index: number, pos: number, numItems: number) => {
26 return index - pos < 0 ? numItems - Math.abs(index - pos) : index - pos;
27};
28
29const getInitialState = (numItems: number): CarouselState => ({ pos: numItems - 1, sliding: false, dir: NEXT });
30

Callers 1

CarouselFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…