import { BoxSlider } from './box-slider' ; let boxSliders = [ ] ; let resizeDebounceTimer ; window . addEventListener ( 'resize' , ( ) => { window . clearTimeout ( resizeDebounceTimer ) ; resizeDebounceTimer = window . setTimeout ( ( ) => boxSliders . forEach ( b => b . reset ( ) ) , 500 ) ; } ) ; export const responder = { add ( boxSlider ) { boxSliders . push ( boxSlider ) ; } , remove ( boxSlider ) { boxSliders = boxSliders . filter ( b => b !== boxSlider ) ; } } ;