This repository was archived by the owner on Apr 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Allow out-of-order dependencies registrationΒ #2
Copy link
Copy link
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needednew featureNew feature or requestNew feature or request
Description
Problem description:
Right now, it's only possible to register dependencies in order. This helps achieving type safety, but it's not strictly necessary.
Proposed solution:
-
We could "save" type information in some sort of "associated type" when we register new factories with unmet dependencies (without changing the type of its resolvers, to avoid exposing factories with unmet dependencies).
-
Later, when we register the dependencies, we could take this type information from the "associated type" and use it to "fix" the getters' type, to expose the factories that were hidden before.
Final considerations
This might prove to be difficult, not because of the feasibility of designing the types, but because they might end up being too complex for the TSC type cheker.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needednew featureNew feature or requestNew feature or request