Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

386 B
Raw Blame
import { type Component, lazy } from 'solid-js';

/**
 * `lazy()` for a named export: the module becomes its own chunk, loaded the
 * first time the component renders or `preload()` is called.
 */
export function lazyNamed<
  K extends string,
  M extends Record<K, Component<any>>,
>(load: () => Promise<M>, name: K) {
  return lazy(async () => ({ default: (await load())[name] }));
}