Skip to content

Commit 73b4659

Browse files
committed
Change to use same instance
1 parent 6225088 commit 73b4659

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/common/src/config/ModuleContainer.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
DependencyContainer,
55
Frequency,
66
InjectionToken,
7-
instancePerContainerCachingFactory,
7+
instanceCachingFactory,
88
isClassProvider,
99
isFactoryProvider,
1010
isTokenProvider,
@@ -404,9 +404,7 @@ export class ModuleContainer<
404404
// this enables us to have a singletoned factory
405405
// that returns the same instance for each resolve
406406
this.container.register(key, {
407-
useFactory: instancePerContainerCachingFactory(
408-
declaration.useFactory
409-
),
407+
useFactory: instanceCachingFactory(declaration.useFactory),
410408
});
411409
} else if (isClassProvider(declaration)) {
412410
this.container.register(key, declaration, {

0 commit comments

Comments
 (0)