Finish the custom incrementer component

This commit is contained in:
Oliver-Akins 2024-04-10 21:27:10 -06:00
parent 878d278303
commit c5c5a71587
5 changed files with 112 additions and 89 deletions

View file

@ -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);
}
};
}
};