{"size": 729, "ext": "js", "max_stars_repo_path": "app/controllers/Component.js", "max_stars_repo_name": "BarakChamo/mobileShooter-LAN", "max_stars_repo_stars_event_min_datetime": "2015-10-01T00:43:11.000Z", "max_stars_repo_stars_event_max_datetime": "2015-11-23T02:17:32.000Z", "max_issues_repo_path": "app/controllers/Component.js", "max_issues_repo_name": "BarakChamo/mobileShooter-LAN", "max_issues_repo_issues_event_min_datetime": "2015-09-04T23:36:36.000Z", "max_issues_repo_issues_event_max_datetime": "2015-09-04T23:36:36.000Z", "max_forks_repo_path": "app/controllers/Component.js", "max_forks_repo_name": "BarakChamo/mobileShooter-LAN", "max_forks_repo_forks_event_min_datetime": "2015-08-27T17:38:11.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-22T20:17:18.000Z"}
{"max_stars_count": 4, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 13.2545454545, "max_line_length": 98, "alphanum_fraction": 0.6598079561}
export default class ComponentController {
	constructor(Component) {
		this.component = Component
		this.components = {}
	}

	add(instance) {
		let component = instance instanceof this.component ? instance : new this.component(...arguments)
		
		component.controllers.push(this)
		this.components[component.id] = component

		return component
	}

	remove() {

	}

	removeChild(child) {
		let id = child.id
		this.components[id] = null
		delete this.components[id]
	}

	removeAll() {

	}

	disableChild() {

	}

	enableChild() {

	}

	getChild(id) {
		return this.components[id]
	}

	getAll() {

	}

	runOnAll(fn) {
		for (let id in this.components) {
			fn(this.components[id])
		}
	}

	runOnChild(id, fn) {
		components[id]
	}
}