radiostasis/src/index.ts

12 lines
272 B
TypeScript

function getOrThrow<T>(element: T | null): T {
if (!element) {
throw new Error("tried to get an element that doesn't exist");
}
return element;
}
document.addEventListener('DOMContentLoaded', () => {
// start application
new Radiostasis().initialize();
});