Finish the custom incrementer component
This commit is contained in:
parent
878d278303
commit
c5c5a71587
5 changed files with 112 additions and 89 deletions
|
|
@ -1 +1,21 @@
|
|||
import "./incrementer.mjs";
|
||||
import { DotDungeonIncrementer } from "./incrementer.mjs";
|
||||
|
||||
const components = [
|
||||
DotDungeonIncrementer,
|
||||
];
|
||||
|
||||
export function registerCustomComponents() {
|
||||
(CONFIG.CACHE ??= {}).componentListeners ??= [];
|
||||
for (const component of components) {
|
||||
if (!window.customElements.get(component.elementName)) {
|
||||
console.debug(`.dungeon | Registering component "${component.elementName}"`);
|
||||
window.customElements.define(
|
||||
component.elementName,
|
||||
component
|
||||
);
|
||||
if (component.formAssociated) {
|
||||
CONFIG.CACHE.componentListeners.push(component.elementName);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue