import React from 'react' ; export function debounce < T extends ( ... args : unknown [ ] ) => unknown > ( func , wait , immediate ? ) { let timeout ; return function ( ... rest ) { const context = this ; const args = rest ; const later = function ( ) { timeout = null ; if ( ! immediate ) { func . apply ( context , args ) ; } } ; const callNow = immediate && ! timeout ; clearTimeout ( timeout ) ; timeout = setTimeout ( later , wait ) ; if ( callNow ) { func . apply ( context , args ) ; } } ; } export function noop ( ) { return undefined ; } export function identity < T > ( a ) { return a ; } export function isNotTouchEvent ( e ) { return e . touches . length > 1 || ( e . type . toLowerCase ( ) === 'touchend' && e . touches . length > 0 ) ; }