#69 : Code cleanup
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
import { tappable } from '../../actions/tappable'
|
||||
import {
|
||||
addResizeEventListener,
|
||||
removeResizeEventListener
|
||||
removeResizeEventListener,
|
||||
} from '../../utils/event'
|
||||
import {
|
||||
applyParticleSizes,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getValueInRange } from './math'
|
||||
|
||||
export function getIndexesOfPagesWithoutClonesInScroll({
|
||||
export function getIndexesOfParticlesWithoutClonesInPage({
|
||||
pageIndex,
|
||||
particlesToShow,
|
||||
particlesToScroll,
|
||||
@@ -47,7 +47,7 @@ export function getAdjacentIndexes({
|
||||
pagesCount - 1, // needed to clone last page particles
|
||||
])].sort((a, b) => a - b)
|
||||
const particleIndexes = pageIndexes.flatMap(
|
||||
pageIndex => getIndexesOfPagesWithoutClonesInScroll({
|
||||
pageIndex => getIndexesOfParticlesWithoutClonesInPage({
|
||||
pageIndex,
|
||||
particlesToShow,
|
||||
particlesToScroll,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {
|
||||
getIndexesOfPagesWithoutClonesInScroll,
|
||||
getIndexesOfParticlesWithoutClonesInPage,
|
||||
getAdjacentIndexes,
|
||||
} from './lazy.js'
|
||||
|
||||
describe('getIndexesOfPagesWithoutClonesInScroll', () => {
|
||||
describe('getIndexesOfParticlesWithoutClonesInPage', () => {
|
||||
it('returns correct range if particlesToShow < particlesToScroll', () => {
|
||||
const testCases = [
|
||||
{ pageIndex: 0, particlesToShow: 3, particlesCount: 9, particlesToScroll: 4, expected: [0, 1, 2, 3] },
|
||||
@@ -17,7 +17,7 @@ describe('getIndexesOfPagesWithoutClonesInScroll', () => {
|
||||
particlesCount,
|
||||
expected,
|
||||
}) => {
|
||||
expect(getIndexesOfPagesWithoutClonesInScroll({
|
||||
expect(getIndexesOfParticlesWithoutClonesInPage({
|
||||
pageIndex,
|
||||
particlesToShow,
|
||||
particlesToScroll,
|
||||
@@ -39,7 +39,7 @@ describe('getIndexesOfPagesWithoutClonesInScroll', () => {
|
||||
particlesCount,
|
||||
expected,
|
||||
}) => {
|
||||
expect(getIndexesOfPagesWithoutClonesInScroll({
|
||||
expect(getIndexesOfParticlesWithoutClonesInPage({
|
||||
pageIndex,
|
||||
particlesToShow,
|
||||
particlesToScroll,
|
||||
@@ -61,7 +61,7 @@ describe('getIndexesOfPagesWithoutClonesInScroll', () => {
|
||||
particlesCount,
|
||||
expected,
|
||||
}) => {
|
||||
expect(getIndexesOfPagesWithoutClonesInScroll({
|
||||
expect(getIndexesOfParticlesWithoutClonesInPage({
|
||||
pageIndex,
|
||||
particlesToShow,
|
||||
particlesToScroll,
|
||||
|
||||
Reference in New Issue
Block a user