UNPKG

smooth-scrollbar

Version:

Customize scrollbar in modern browsers with smooth scrolling experience.

20 lines (16 loc) 421 B
import $debounce from 'lodash.debounce'; export function debounce(...options) { return (_proto: any, key: string, descriptor: PropertyDescriptor) => { const fn = descriptor.value; return { get() { if (!this.hasOwnProperty(key)) { Object.defineProperty(this, key, { value: $debounce(fn, ...options), }); } return this[key]; }, }; }; }