debounce the beep

This commit is contained in:
MathuraMG 2016-08-08 13:49:45 -04:00
parent 7cb9475b44
commit 250cd0ae9d
1 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class Editor extends React.Component {
gutters: ['CodeMirror-lint-markers'],
keyMap: 'sublime',
lint: {
onUpdateLinting: (annotations) => {
onUpdateLinting: debounce(2000, (annotations) => {
let isVisible = false;
document.getElementById('editor-lintmessages').innerHTML = '';
annotations.forEach((x) => {
@ -47,7 +47,8 @@ class Editor extends React.Component {
if (isVisible) {
this.beep.play();
}
}
})
}
});
this._cm.on('change', debounce(200, () => {