mirror of
https://github.com/chinchang/web-maker.git
synced 2025-05-11 12:55:22 +02:00
app: throttle codesize calculation
This commit is contained in:
parent
2e4eb77056
commit
ea64351f52
@ -701,7 +701,14 @@ export default class App extends Component {
|
||||
}
|
||||
}
|
||||
if (this.state.prefs.isJs13kModeOn) {
|
||||
this.calculateCodeSize();
|
||||
// Throttling codesize calculation
|
||||
if (this.codeSizeCalculationTimeout) {
|
||||
clearTimeout(this.codeSizeCalculationTimeout);
|
||||
}
|
||||
this.codeSizeCalculationTimeout = setTimeout(() => {
|
||||
this.calculateCodeSize();
|
||||
this.codeSizeCalculationTimeout = null;
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
onCodeSettingsChange(type, settings) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user