FactoryProvider · Core API
type FactoryProvider<T, TDeps> = object;Provider that lazily creates a token value from typed dependencies.
deps keys become the properties passed to useFactory, scope controls
caching lifetime, and onDispose runs for cached singleton/scoped instances.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
|
|
‐ |
|
|
|
Properties
Section titled “Properties”provide
Section titled “provide”readonly provide: Token<T>;Token registered by this provider.
readonly optional deps?: TDeps;Named dependencies resolved before the factory is called.
scope?
Section titled “scope?”readonly optional scope?: Scope;Caching lifetime for the created value.
useFactory
Section titled “useFactory”readonly useFactory: Factory<T, TDeps>;Function that creates the token value.
onDispose?
Section titled “onDispose?”readonly optional onDispose?: DisposeHook<T>;Cleanup hook for cached values.