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

Function injectWindowVirtualizer

packages/angular-virtual/src/index.ts:120–141  ·  view source on GitHub ↗
(
  options: () => PartialKeys<
    VirtualizerOptions<Window, TItemElement>,
    | 'getScrollElement'
    | 'observeElementRect'
    | 'observeElementOffset'
    | 'scrollToFn'
  >,
)

Source from the content-addressed store, hash-verified

118}
119
120export function injectWindowVirtualizer<TItemElement extends Element>(
121 options: () => PartialKeys<
122 VirtualizerOptions<Window, TItemElement>,
123 | 'getScrollElement'
124 | 'observeElementRect'
125 | 'observeElementOffset'
126 | 'scrollToFn'
127 >,
128): AngularVirtualizer<Window, TItemElement> {
129 const resolvedOptions = computed(() => {
130 return {
131 getScrollElement: () => (typeof document !== 'undefined' ? window : null),
132 observeElementRect: observeWindowRect,
133 observeElementOffset: observeWindowOffset,
134 scrollToFn: windowScroll,
135 initialOffset: () =>
136 typeof document !== 'undefined' ? window.scrollY : 0,
137 ...options(),
138 }
139 })
140 return createVirtualizerBase<Window, TItemElement>(resolvedOptions)
141}

Callers 3

AppComponentClass · 0.90

Calls 1

createVirtualizerBaseFunction · 0.70

Tested by

no test coverage detected