microsoft / microsoft/tsyringe

[feat]: make the `DependencyContainer#disposed` property available

Open
#249 0 comments 0 reactions 1 assignee View on GitHub

@Xapphire13 is already working on this.

Since Dec 22, 2024.

awaiting triage enhancement
Dominant language
TypeScript
Stars
6k
Forks
184
Avg merge
3m
Merged PRs (30d)
1

Description

Description

For testing related to the container disposal, I realized that the InternalDependencyContainer has a disposed property but it's private.

Only for cases like testing, this property can be very useful and should be public or have a getter

Alternate solutions

As a solution or an alternative suggestion, we can have something like:

InternalDependencyContainer

class InternalDependencyContainer implements DependencyContainer {
  private disposed = false;

  // Unchanged code...

  public isDisposed() {
    return this.disposed;
  }
}

DependencyContainer

export default interface DependencyContainer extends Disposable {
  // Unchanged code...

  isDisposed(): boolean;
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.