UNPKG

ngx-fastboot

Version:

ngx-fastboot is an Angular library designed to dynamically load configuration settings at runtime, optimizing application startup performance by offloading configurations to a separate compilation chunk.

18 lines (13 loc) 422 B
import { Type } from '@angular/core'; import { isTypeProvider } from './is-type-provider'; import { loadModule } from './load-module'; import { FastComponent } from './types'; export const resolveComponent = async ( component: FastComponent, ): Promise<Type<unknown>> => { if (isTypeProvider(component)) { return component; } const loadedProvider = await loadModule(component); return loadedProvider; };