layout changes WIP

This commit is contained in:
zadam
2020-02-27 00:58:10 +01:00
parent 7bcae9981b
commit 637010577b
9 changed files with 101 additions and 68 deletions

View File

@@ -2,19 +2,19 @@ import utils from '../services/utils.js';
import Mutex from "../services/mutex.js";
export default class Component {
/**
* @param {Component} parent
*/
constructor(parent) {
constructor() {
this.componentId = `comp-${this.constructor.name}-` + utils.randomString(6);
/** @type Component */
this.parent = parent;
/** @type Component[] */
this.children = [];
this.initialized = Promise.resolve();
this.mutex = new Mutex();
}
setParent(parent) {
/** @type Component */
this.parent = parent;
}
async handleEvent(name, data) {
await this.initialized;