{"size": 408, "ext": "js", "max_stars_repo_path": "chapter-3/samples/binding-behaviors/src/signal.js", "max_stars_repo_name": "dudumanbogdan/Learning-Aurelia", "max_stars_repo_stars_event_min_datetime": "2016-12-26T21:24:33.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-08T13:12:03.000Z", "max_issues_repo_path": "chapter-3/samples/binding-behaviors/src/signal.js", "max_issues_repo_name": "dudumanbogdan/Learning-Aurelia", "max_issues_repo_issues_event_min_datetime": "2017-02-08T17:55:52.000Z", "max_issues_repo_issues_event_max_datetime": "2019-02-22T11:32:56.000Z", "max_forks_repo_path": "chapter-3/samples/binding-behaviors/src/signal.js", "max_forks_repo_name": "dudumanbogdan/Learning-Aurelia", "max_forks_repo_forks_event_min_datetime": "2017-01-30T18:19:26.000Z", "max_forks_repo_forks_event_max_datetime": "2018-04-03T10:14:08.000Z"}
{"max_stars_count": 16, "max_issues_count": 5, "max_forks_count": 14, "avg_line_length": 19.4285714286, "max_line_length": 79, "alphanum_fraction": 0.693627451}
import {inject} from 'aurelia-framework';
import {BindingSignaler} from 'aurelia-templating-resources';

@inject(BindingSignaler)
export class Signal {

  lastUpdatedAt = new Date();

  constructor(signaler) {
    this.signaler = signaler;
  }

  activate() {
    this.intervalHandle = setInterval(() => this.signaler.signal('now'), 2000);
  }

  deactivate() {
    clearInterval(this.intervalHandle);
  }
}
