{"size": 586, "ext": "js", "max_stars_repo_path": "spec/use-transition/use_log_controller.js", "max_stars_repo_name": "abunch/stimulus-use", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "spec/use-transition/use_log_controller.js", "max_issues_repo_name": "abunch/stimulus-use", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "spec/use-transition/use_log_controller.js", "max_forks_repo_name": "abunch/stimulus-use", "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": 26.6363636364, "max_line_length": 92, "alphanum_fraction": 0.6655290102}
import { Controller } from '@hotwired/stimulus'
import { useTransition } from '../../src'

export default class UseLogController extends Controller {
  initialize() {
    this.application.testLogger.log({ id: this.id, event: 'initialize', type: 'lifecycle' })
  }

  connect() {
    useTransition(this)
    this.application.testLogger.log({ id: this.id, event: 'connect', type: 'lifecycle' })
  }

  disconnect() {
    this.application.testLogger.log({ id: this.id, event: 'disconnect', type: 'lifecycle' })
  }

  get id() {
    return this.element.dataset.id || this.element.id
  }
}
