Skip to content

Commit 240d687

Browse files
committed
fix(ViewportCollector): adjust debounce timeouts
The timeouts are calculated based on an 60hz monitor. Dimensions update should trigger every 5th frame, idle should get triggerd after each 10th frame.
1 parent 34f0b36 commit 240d687

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ViewportCollector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default class ViewportCollector extends React.PureComponent<IProps> {
192192
Object.assign(this.dimensionsState, getClientDimensions());
193193

194194
this.componentMightHaveUpdated = true;
195-
}, 80);
195+
}, 88);
196196

197197
getPublicScroll: ((scroll: IScroll) => IScroll) = memoize(
198198
(scroll: IScroll): IScroll => ({ ...scroll }),
@@ -239,7 +239,7 @@ export default class ViewportCollector extends React.PureComponent<IProps> {
239239
if (typeof this.props.onIdledUpdate === 'function') {
240240
this.props.onIdledUpdate(...args);
241241
}
242-
}, 700);
242+
}, 166);
243243

244244
getPropsFromState(): IViewport {
245245
return {

0 commit comments

Comments
 (0)