Typescript: IntervalSubscription

Date: 2021-04-06
export class IntervalSubscription implements IEventSubscription {
    interval: NodeJS.Timeout;
    constructor(fn: () => void, ms: number) {
        this.interval = setInterval(fn, ms);
    }

    unsubscribe(): void {
        clearInterval(this.interval);
    }
}
48190cookie-checkTypescript: IntervalSubscription