diff --git a/src/services/ScrollService.ts b/src/services/ScrollService.ts index 49b2e939..8215a64f 100644 --- a/src/services/ScrollService.ts +++ b/src/services/ScrollService.ts @@ -1,7 +1,7 @@ -import { bind, debounce } from 'decko'; +import { bind } from 'decko'; import { EventEmitter } from 'eventemitter3'; -import { isBrowser, querySelector } from '../utils'; +import { isBrowser, querySelector, Throttle } from '../utils'; import { RedocNormalizedOptions } from './RedocNormalizedOptions'; const EVENT = 'scroll'; @@ -75,7 +75,7 @@ export class ScrollService { } @bind - @debounce(100) + @Throttle(100) handleScroll() { const scrollY = this.scrollY(); const isScrolledDown = scrollY - this._prevOffsetY > 0; diff --git a/src/utils/index.ts b/src/utils/index.ts index 4a2f25fd..6c29d963 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -6,3 +6,4 @@ export * from './helpers'; export * from './highlight'; export * from './loadAndBundleSpec'; export * from './dom'; +export * from './decorators';