mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	progress
This commit is contained in:
		| @@ -1,16 +1,22 @@ | ||||
| export default class Component { | ||||
|     /** @param {AppContext} appContext */ | ||||
|     constructor(appContext) { | ||||
|         this.componentId = `component-${this.constructor.name}`; | ||||
|         this.appContext = appContext; | ||||
|         /** @type Component[] */ | ||||
|         this.children = []; | ||||
|         this.initialized = Promise.resolve(); | ||||
|     } | ||||
|  | ||||
|     eventReceived(name, data) { | ||||
|     async eventReceived(name, data) { | ||||
|         await this.initialized; | ||||
|  | ||||
|         console.log(`Received ${name} to ${this.componentId}`); | ||||
|  | ||||
|         const fun = this[name + 'Listener']; | ||||
|  | ||||
|         if (typeof fun === 'function') { | ||||
|             fun.call(this, data); | ||||
|             await fun.call(this, data); | ||||
|         } | ||||
|  | ||||
|         for (const child of this.children) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user