@tanstack/virtual-core
Advanced tools
Comparing version 3.11.2 to 3.11.3
@@ -442,12 +442,22 @@ import { debounce, memo, notUndefined, approxEqual } from "./utils.js"; | ||
this.getIndexes = memo( | ||
() => [ | ||
this.options.rangeExtractor, | ||
this.calculateRange(), | ||
this.options.overscan, | ||
this.options.count | ||
], | ||
(rangeExtractor, range, overscan, count) => { | ||
return range === null ? [] : rangeExtractor({ | ||
startIndex: range.startIndex, | ||
endIndex: range.endIndex, | ||
() => { | ||
let startIndex = null; | ||
let endIndex = null; | ||
const range = this.calculateRange(); | ||
if (range) { | ||
startIndex = range.startIndex; | ||
endIndex = range.endIndex; | ||
} | ||
return [ | ||
this.options.rangeExtractor, | ||
this.options.overscan, | ||
this.options.count, | ||
startIndex, | ||
endIndex | ||
]; | ||
}, | ||
(rangeExtractor, overscan, count, startIndex, endIndex) => { | ||
return startIndex === null || endIndex === null ? [] : rangeExtractor({ | ||
startIndex, | ||
endIndex, | ||
overscan, | ||
@@ -454,0 +464,0 @@ count |
{ | ||
"name": "@tanstack/virtual-core", | ||
"version": "3.11.2", | ||
"version": "3.11.3", | ||
"description": "Headless UI for virtualizing scrollable elements in TS/JS + Frameworks", | ||
@@ -5,0 +5,0 @@ "author": "Tanner Linsley", |
@@ -700,14 +700,24 @@ import { approxEqual, debounce, memo, notUndefined } from './utils' | ||
private getIndexes = memo( | ||
() => [ | ||
this.options.rangeExtractor, | ||
this.calculateRange(), | ||
this.options.overscan, | ||
this.options.count, | ||
], | ||
(rangeExtractor, range, overscan, count) => { | ||
return range === null | ||
() => { | ||
let startIndex: number | null = null | ||
let endIndex: number | null = null | ||
const range = this.calculateRange() | ||
if (range) { | ||
startIndex = range.startIndex | ||
endIndex = range.endIndex | ||
} | ||
return [ | ||
this.options.rangeExtractor, | ||
this.options.overscan, | ||
this.options.count, | ||
startIndex, | ||
endIndex, | ||
] | ||
}, | ||
(rangeExtractor, overscan, count, startIndex, endIndex) => { | ||
return startIndex === null || endIndex === null | ||
? [] | ||
: rangeExtractor({ | ||
startIndex: range.startIndex, | ||
endIndex: range.endIndex, | ||
startIndex, | ||
endIndex, | ||
overscan, | ||
@@ -714,0 +724,0 @@ count, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
198313
2810