Skip to content

Commit

Permalink
fix(dfx-helper): set intervals, subscriptions and timeouts to undefined
Browse files Browse the repository at this point in the history
on ngOnDestroy
  • Loading branch information
Dafnik committed Feb 12, 2023
1 parent 3b9a6a0 commit 2d5af86
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/dfx-helper/src/lib/components/abstract-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,20 @@ export abstract class ABlock {
for (const subscription of this.subscriptions) {
subscription.unsubscribe();
}
this.subscriptions = undefined;
}
if (this.timeouts) {
for (const timeout of this.timeouts) {
clearTimeout(timeout);
}
this.timeouts = undefined;
}

if (this.intervals) {
for (const interval of this.intervals) {
clearInterval(interval);
}
this.intervals = undefined;
}
}
}

0 comments on commit 2d5af86

Please sign in to comment.