MCPcopy Index your code
hub / github.com/TanStack/virtual / get

Method get

packages/virtual-core/src/index.ts:377–396  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375 let _ro: ResizeObserver | null = null
376
377 const get = () => {
378 if (_ro) {
379 return _ro
380 }
381
382 if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
383 return null
384 }
385
386 return (_ro = new this.targetWindow.ResizeObserver((entries) => {
387 entries.forEach((entry) => {
388 const run = () => {
389 this._measureElement(entry.target as TItemElement, entry)
390 }
391 this.options.useAnimationFrameWithResizeObserver
392 ? requestAnimationFrame(run)
393 : run()
394 })
395 }))
396 }
397
398 return {
399 disconnect: () => {

Callers 3

VirtualizerClass · 0.80
getFunction · 0.80

Calls 1

runFunction · 0.70

Tested by

no test coverage detected