From de01b37a4ae067ca264bf85824921eb1a5ff81ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Am=C3=A9rico?= Date: Sun, 13 Aug 2023 09:18:02 -0300 Subject: [PATCH] format `utils` --- src/lib/utils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 8177714..77e52f7 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -13,17 +13,17 @@ export function scrollSpeed(refresh = 200) { let isScrollingFast: ReturnType | undefined; return ( - size: number, + speed: number, callback: { fast: () => void; slow: () => void; - } + }, ) => (scrollPosition: number) => { if (!lastScrollPosition) { lastScrollPosition = scrollPosition; } else { - if (Math.abs(scrollPosition - lastScrollPosition) > size) { + if (Math.abs(scrollPosition - lastScrollPosition) > speed) { callback.fast(); if (isScrollingFast !== undefined) { @@ -59,7 +59,7 @@ export const getGridIndices = ( height: number, columnCount: number, overScanColumn: number, - scrollPosition: number + scrollPosition: number, ) => { const indices: number[] = []; @@ -71,7 +71,7 @@ export const getGridIndices = ( const endIndexTemp = Math.min( itemCount, - round.ceil(((scrollPosition + height) / itemHeight) * columnCount, columnCount) + round.ceil(((scrollPosition + height) / itemHeight) * columnCount, columnCount), ); const endIndexOverScan = endIndexTemp + overScanColumn; const endIndex = endIndexOverScan < itemCount ? endIndexOverScan : itemCount; @@ -86,7 +86,7 @@ export const getListIndices = ( itemSize: number, size: number, overScan: number, - scrollPosition: number + scrollPosition: number, ) => { const indices: number[] = [];