category: typescript
Posts
checked-inject
TypeScript dependency injection with compile-time verification
This started as personal learning experiment to create a dependency injection library. I soon realized the entire dependency graph could be represented in the type system, and can be enforced statically when requesting a resource from the DI container. This includes considering whether:
- A dependency has been provided
- A dependency can be resolved synchronously
- The request is made within the scopes associated with each dependency