Skip to content

Commit ec6c489

Browse files
committed
Remove debounce
1 parent 4e0aa64 commit ec6c489

File tree

1 file changed

+3
-6
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Content

1 file changed

+3
-6
lines changed

packages/app/src/app/pages/Sandbox/Editor/Content/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Prompt } from 'react-router-dom';
55
import { reaction } from 'mobx';
66
import { TextOperation } from 'ot';
77
import { inject, observer } from 'mobx-react';
8-
import { debounce } from 'lodash-es';
98

109
import getTemplateDefinition from 'common/lib/templates';
1110
import type { ModuleError } from 'common/lib/types';
@@ -64,8 +63,6 @@ class EditorPreview extends React.Component<Props, State> {
6463
() => this.forceUpdate()
6564
);
6665

67-
this.getBounds = debounce(this.getBoundsInstantly, 100);
68-
6966
window.addEventListener('resize', this.getBounds);
7067

7168
this.interval = setInterval(() => {
@@ -87,7 +84,7 @@ class EditorPreview extends React.Component<Props, State> {
8784
}
8885
}
8986

90-
getBoundsInstantly = el => {
87+
getBounds = el => {
9188
if (el) {
9289
this.el = this.el || el;
9390
}
@@ -331,7 +328,7 @@ class EditorPreview extends React.Component<Props, State> {
331328
() => this.props.store.editor.previewWindowVisible,
332329
() => {
333330
requestAnimationFrame(() => {
334-
this.getBoundsInstantly();
331+
this.getBounds();
335332
});
336333
}
337334
);
@@ -552,7 +549,7 @@ class EditorPreview extends React.Component<Props, State> {
552549
}}
553550
>
554551
<div
555-
ref={this.getBoundsInstantly}
552+
ref={this.getBounds}
556553
style={{
557554
position: 'relative',
558555
display: 'flex',

0 commit comments

Comments
 (0)