20 lines
322 B
JavaScript
20 lines
322 B
JavaScript
class App {
|
|
constructor(components) {
|
|
this.components = components || []
|
|
}
|
|
|
|
add(c) {
|
|
this.components.push(c)
|
|
|
|
return this
|
|
}
|
|
|
|
init() {
|
|
for (let u = 0, x = this.components.length; u < x; u++) {
|
|
this.components[u].init()
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = App
|