Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.
This repository was archived by the owner on Apr 21, 2024. It is now read-only.

Allow out-of-order dependencies registration #2

Open
@castarco

Description

@castarco

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:

  1. 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).

  2. 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

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions