You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/web/routes/uix/components/icon/icon-registry.ts

11 lines
405 B

import type { Component } from 'svelte';
const iconModules = import.meta.glob<{ default: Component }>(
'/src/uix/eidos/components/icon/lib/*.svelte'
);
export function loadRegisteredIcon(name: string): Promise<Component | undefined> {
const loader = iconModules[`/src/uix/eidos/components/icon/lib/${name}.svelte`];
return loader?.().then((module) => module.default) ?? Promise.resolve(undefined);
}

Powered by TurnKey Linux.