UNPKG

@dfds-devex/minions-core

Version:

Component framework for micro frontend architecture.

35 lines (34 loc) 1.16 kB
import { LitElement } from "lit-element"; //IDEA.TODO: Read this @ https://www.typescriptlang.org/docs/handbook/mixins.html //IDEA.TODO: Read this @ https://mariusschulz.com/blog/mixin-classes-in-typescript export default class Minion extends LitElement { constructor(options, loaders) { super(); this.options = options; if (this.plugins !== undefined) { this.plugins.forEach((plugin) => { const loader = loaders === null || loaders === void 0 ? void 0 : loaders.find((item) => { if (item.canLoad(plugin)) { return item; } return undefined; }); if (loader) { loader.load(plugin, this); } }); } } get plugins() { if (this.options !== undefined) { return this.options.plugins; } return undefined; } get identifier() { if (this.options !== undefined) { return this.options.identifier; } return undefined; } }