Skip to content

Make it easier to access parent dependency container inside modules #276

@rpanic

Description

@rpanic

Currently, in our codebase, we have a lot of spots like this:

public constructor(
  @inject("Sequencer")
  private readonly sequencer: Sequencer<SequencerModulesRecord>
) {}

so we can then later in some method of the module do

this.sequencer.dependencyContainer.resolve("Foo");

Therefore, I propose that every ModuleContainer self-injects itself in its own dependency container, so that modules can have a simpler syntax:

public constructor(
  @inject("ParentContainer")
  private readonly parent: ParentModuleContainer
) {}
  

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions