Open arthur-fontaine opened 3 months ago
Any updates on this? 👀
@loicnestler The repo seems to be dead (last commit was 2 years ago). I created Diabolo to get type-safe DI, but it is not based on the concept of containers.
Will get back to the repo this summer 🤞 Got stuck on ESM / CJS migration 😮💨
Sorry for letting everyone down :(
Is your feature request related to a problem? Please describe.
Considering the following code.
It is a problem in this example:
We are requiring from
kitchenContainer
two dependencies:over
anduserManual
. But we are only providinguserManual
. This will cause an error at run-time.Describe the solution you'd like
The returned type of
getContainerSet
should be automatically inferred from what we pass in parameter.Solution
(tested and it works)
Edit these lines https://github.com/molszanski/iti/blob/0a3a006113b4176316c308805314a135c0f47902/iti/src/iti.ts#L371-L373 to
(This solution may be applicable to other functions like
subscribeToContainerSet
and_extractTokens
too)Note: We can improve the type printing (on hovering on VSCode for example), by wrapping the
Pick<...>
into thePrettify
helper.Prettify
Prettify