{"size": 440, "ext": "js", "max_stars_repo_path": "src/engine/index.js", "max_stars_repo_name": "liketurbo/halloween-doodle-2016-bot", "max_stars_repo_stars_event_min_datetime": "2020-05-06T22:00:23.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-06T22:00:23.000Z", "max_issues_repo_path": "src/engine/index.js", "max_issues_repo_name": "liketurbo/halloween-doodle-2016-bot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/engine/index.js", "max_forks_repo_name": "liketurbo/halloween-doodle-2016-bot", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 16.9230769231, "max_line_length": 43, "alphanum_fraction": 0.5954545455}
import handleRunKeys from "./handleRunKeys"

const genAppState = canvasElem => {
  const state = {
    activate: () => {
      state.onActivate.forEach(fn => fn())

      state.active = true
    },
    active: false,
    disable: () => {
      state.onDisable.forEach(fn => fn())

      state.active = false
    },
    onActivate: [],
    onDisable: [],
  }

  handleRunKeys(state, canvasElem)

  return state
}

export default genAppState
