mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 05:51:55 +00:00
Refactor autosave interval to a const
This commit is contained in:
parent
fc5a5b161b
commit
0d6c0f647c
@ -19,6 +19,7 @@ import { ProcessManagerService } from '../services/processmanager.service';
|
|||||||
const modelist = brace.acequire('ace/ext/modelist');
|
const modelist = brace.acequire('ace/ext/modelist');
|
||||||
|
|
||||||
const defaultSourceCode = `alert( 'Hello, world!' );`;
|
const defaultSourceCode = `alert( 'Hello, world!' );`;
|
||||||
|
const autosave_interval = 10000;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-webide',
|
selector: 'app-webide',
|
||||||
@ -48,7 +49,7 @@ export class WebideComponent implements OnInit {
|
|||||||
this.requestCode();
|
this.requestCode();
|
||||||
this.processManagerService.init();
|
this.processManagerService.init();
|
||||||
this.processManagerService.subscribeCallback('login', (event) => { this.setButtonStateSaved(); });
|
this.processManagerService.subscribeCallback('login', (event) => { this.setButtonStateSaved(); });
|
||||||
setInterval(() => { this.sendCodeIfDirty(); }, 10000);
|
setInterval(() => { this.sendCodeIfDirty(); }, autosave_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribeWS() {
|
subscribeWS() {
|
||||||
|
Loading…
Reference in New Issue
Block a user