fix: resolve menu synchronization issue (use proper throttle)

This commit is contained in:
Roman Hotsiy 2018-02-07 22:53:55 +02:00
parent 29207cf0d2
commit 84d1c7b2f2
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -6,3 +6,4 @@ export * from './helpers';
export * from './highlight';
export * from './loadAndBundleSpec';
export * from './dom';
export * from './decorators';