export class ActivityTrackerService {
  constructor() {
    this.track();
  }

  get mostRecentActivity() {
    return this.timestamp;
  }

  track() {
    this.timestamp = Date.now();
  }

  activeWithinTimespan(timespan) {
    console.log(Date.now() - this.timestamp, (Date.now() - this.timestamp) <= timespan);
    return (Date.now() - this.timestamp) <= timespan;
  }
}
export class ActivityTrackerService {
  constructor() {
    this.track();
  }

  get mostRecentActivity() {
    return this.timestamp;
  }

  track() {
    this.timestamp = Date.now();
  }

  activeWithinTimespan(timespan) {
    return (Date.now() - this.timestamp) <= timespan;
  }
}

Stop logging from activity tracker