You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds type validation to all binding methods on a `TypedContainer`
or `TypedModule`, including `toClass`, `toHigherOrderFunction` and
`toCurry`, allowing TypeScript to catch common errors when defining
bindings, such as omitting or mixing up dependency keys.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,8 @@ Then you can bind the dependency to a value, a function, a class, a factory, a h
36
36
37
37
You can define a registry type or interface to get full type safety for your dependency injection keys and their corresponding types. This eliminates the need for manual casting when resolving dependencies.
38
38
39
+
The container also validates that the dependencies you provide match what your classes or functions expect. TypeScript will catch errors at compile time such as omitting required dependencies or providing the wrong dependency types.
40
+
39
41
### Create the Registry
40
42
41
43
Define a type or interface that maps your injection tokens to the desired types:
0 commit comments