fix(core): update

This commit is contained in:
2020-05-25 21:49:35 +00:00
parent 4d0fb3eb30
commit 93778e1bcf
9 changed files with 148 additions and 71 deletions

View File

@@ -3,7 +3,7 @@ import * as plugins from './smarttime.plugins';
export class Interval {
public status: 'started' | 'stopped' | 'initial' = 'initial';
private statusAuthorization: any = null;
public intervalMilliseconds: number;
public intervalJobs: Array<() => any> = [];
constructor(intervalMillisencondsArg: number) {
@@ -23,7 +23,7 @@ export class Interval {
runInterval();
}
public stop () {
public stop() {
this.status = 'stopped';
this.statusAuthorization = null;
}
@@ -32,9 +32,9 @@ export class Interval {
this.intervalJobs.push(funcArg);
}
private executeIntervalJobs () {
private executeIntervalJobs() {
for (const funcArg of this.intervalJobs) {
funcArg();
}
}
}
}