MCPcopy Index your code
hub / github.com/TanStack/table / passiveEventSupported

Function passiveEventSupported

packages/table-core/src/features/ColumnSizing.ts:556–577  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

554
555let passiveSupported: boolean | null = null
556export function passiveEventSupported() {
557 if (typeof passiveSupported === 'boolean') return passiveSupported
558
559 let supported = false
560 try {
561 const options = {
562 get passive() {
563 supported = true
564 return false
565 },
566 }
567
568 const noop = () => {}
569
570 window.addEventListener('test', noop, options)
571 window.removeEventListener('test', noop)
572 } catch (err) {
573 supported = false
574 }
575 passiveSupported = supported
576 return passiveSupported
577}
578
579function isTouchStartEvent(e: unknown): e is TouchEvent {
580 return (e as TouchEvent).type === 'touchstart'

Callers 1

ColumnSizing.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected