Skip to content

Commit

Permalink
fix: resolve menu synchronization issue (use proper throttle)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Feb 7, 2018
1 parent 29207cf commit 84d1c7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/ScrollService.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -75,7 +75,7 @@ export class ScrollService {
}

@bind
@debounce(100)
@Throttle(100)
handleScroll() {
const scrollY = this.scrollY();
const isScrolledDown = scrollY - this._prevOffsetY > 0;
Expand Down
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './helpers';
export * from './highlight';
export * from './loadAndBundleSpec';
export * from './dom';
export * from './decorators';

0 comments on commit 84d1c7b

Please sign in to comment.