components now track their parent

This commit is contained in:
zadam
2020-02-15 09:43:47 +01:00
parent 9337564075
commit 6d847d22d3
14 changed files with 66 additions and 58 deletions

View File

@@ -2,11 +2,16 @@ import utils from '../services/utils.js';
import Mutex from "../services/mutex.js";
export default class Component {
/** @param {AppContext} appContext */
constructor(appContext) {
/**
* @param {AppContext} appContext
* @param {Component} parent
*/
constructor(appContext, parent) {
this.componentId = `comp-${this.constructor.name}-` + utils.randomString(6);
/** @type AppContext */
this.appContext = appContext;
/** @type Component */
this.parent = parent;
/** @type TabManager */
this.tabManager = appContext.tabManager;
/** @type Component[] */
@@ -59,4 +64,8 @@ export default class Component {
await Promise.all(promises);
}
triggerCommand(name, data) {
}
}