{"size": 652, "ext": "js", "max_stars_repo_path": "frontend/app/services/tasks-manager.js", "max_stars_repo_name": "mike050210/brn", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/app/services/tasks-manager.js", "max_issues_repo_name": "mike050210/brn", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/app/services/tasks-manager.js", "max_forks_repo_name": "mike050210/brn", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.1481481481, "max_line_length": 51, "alphanum_fraction": 0.6825153374}
import Service from '@ember/service';
import { A } from '@ember/array';

export default Service.extend({
  init() {
    this._super(...arguments);
    this.clearCompletedTasks();
    this.clearCurrentCycleTaks();
  },
  saveAsCompleted(task) {
    this.completedTasks.pushObject(task);
    this.completedCycleTasks.pushObject(task);
  },
  isCompleted(task) {
    return this.completedTasks.includes(task);
  },
  isCompletedInCurrentCycle(task) {
    return this.completedCycleTasks.includes(task);
  },
  clearCompletedTasks() {
    this.set('completedTasks', A());
  },
  clearCurrentCycleTaks() {
    this.set('completedCycleTasks', A());
  },
});
