Files
2026-04-17 19:05:33 +02:00

11 lines
395 B
TypeScript

// Load view specific code
const currentView = document.body.dataset["currentView"];
if (currentView) {
// Import the module asynchronously; its top-level code runs on load
import(`./views/${currentView}.ts`)
// If the module exports an `init` function, call it
.then(module => module.init?.())
.catch(() => console.warn(`No module for view: ${currentView}`))
}