Core Features of redi
mainredi provides several advanced dependency injection capabilities:
- Dependency Items: Support for different provider types including Class (
{ useClass }), Value ({ useValue }), Factory ({ useFactory }), and Async ({ useAsync }). - Interface Injection: Use
createIdentifierfor injection based on interfaces. - Lazy Instantiation: Defer the creation of dependencies using the
{ lazy: true }option. - Hierarchy Injection: Support for parent-child injector trees using
@Self()and@SkipSelf()decorators. - Optional & Many: Use
@Optional()for non-mandatory dependencies and@Many()to inject multiple providers for the same identifier. - React Integration: Built-in hooks like
useDependencyandconnectDependencies. - RxJS Support: Reactive programming support via
useObservableanduseUpdateBinder.