1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-06-10 11:45:10 +02:00

app: throttle codesize calculation

This commit is contained in:
Kushagra Gour 2018-08-12 17:50:27 +05:30
parent 2e4eb77056
commit ea64351f52

View File

@ -701,7 +701,14 @@ export default class App extends Component {
} }
} }
if (this.state.prefs.isJs13kModeOn) { 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) { onCodeSettingsChange(type, settings) {