18 lines
308 B
JavaScript
18 lines
308 B
JavaScript
const App = function (components) {
|
|
this.components = components || []
|
|
}
|
|
|
|
App.prototype.add = function (c) {
|
|
this.components.push(c)
|
|
|
|
return this
|
|
}
|
|
|
|
App.prototype.init = function () {
|
|
for (let u = 0, x = this.components.length; u < x; u++) {
|
|
this.components[u].init()
|
|
}
|
|
}
|
|
|
|
module.exports = App
|