UNPKG

smooth-scrollbar

Version:

Customize scrollbar in modern browsers with smooth scrolling experience.

17 lines (13 loc) 319 B
import * as I from '../interfaces/'; import debounce from 'lodash.debounce'; import { eventScope, } from '../utils/'; export function resizeHandler(scrollbar: I.Scrollbar) { const addEvent = eventScope(scrollbar); addEvent( window, 'resize', debounce(scrollbar.update.bind(scrollbar), 300), ); }