I have the following Angular service defined in my project...
@Injectable({ providedIn: 'root' })
export class NodeService extends WebService {
private intervalId: number | undefined;
public start(frequency: number = 1000): void {
if (this.intervalId === undefined) {
this.intervalId = window.setInterval(() => { ... }, frequency);
}
}
}
When start is executed, it forces a DOM update every (frequency) milliseconds, even though the body of the setInterval function is empty.
Any ideas why?