refactor: add frontend debounce constants (#13250)

This commit is contained in:
Jesse Yang
2021-02-19 15:47:44 -10:00
committed by GitHub
parent 42ff4fc19a
commit 571b53e9cf
6 changed files with 31 additions and 12 deletions

View File

@@ -25,6 +25,7 @@ import { debounce } from 'lodash';
import ModalTrigger from 'src/components/ModalTrigger';
import { ConfigEditor } from 'src/components/AsyncAceEditor';
import { FAST_DEBOUNCE } from 'src/constants';
const propTypes = {
onChange: PropTypes.func,
@@ -80,7 +81,7 @@ function TemplateParamsEditor({ code, language, onChange }) {
mode={language}
minLines={25}
maxLines={50}
onChange={debounce(onChange, 200)}
onChange={debounce(onChange, FAST_DEBOUNCE)}
width="100%"
editorProps={{ $blockScrolling: true }}
enableLiveAutocompletion