@spirex/di-dynamic
v1.0.0
Published
@spirex/di extension. Adds support for dynamic modules, allowing you to load parts of your DI container asynchronously at runtime.
Maintainers
Readme
SpireX/DI Dynamic Modules
@spirex/di-dynamic
Adds support for dynamic modules, allowing you to load parts of your container asynchronously at runtime. Perfect for code-splitting and modular applications.
import type { CartService } from "./features/cart"
const CartModule = dynamicModule(
"CartModule",
() => import("./features/cart/index.ts"),
).create<{
cart: CartService,
}>((binder, { CartService }) => {
binder.bindFactory("cart", factoryOf(CartService));
});