Skip to content

Commit

Permalink
Correct comment re: scoped and parent cache
Browse files Browse the repository at this point in the history
  • Loading branch information
fnimick committed Dec 28, 2023
1 parent ab47584 commit 8cbdaa0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,9 @@ export function createContainer<T extends object = any, U extends object = any>(
case Lifetime.SCOPED:
// Scoped lifetime means that the container
// that resolves the registration also caches it.
// When a registration is not found, we travel up
// the family tree until we find one that is cached.
// If this container cache does not have it,
// resolve and cache it rather than using the parent
// container's cache.
cached = container.cache.get(name)
if (cached !== undefined) {
// We found one!
Expand Down

0 comments on commit 8cbdaa0

Please sign in to comment.