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

Commit 11b34fa

Browse files
committed
docs: explain indirect-resolution gotchas
1 parent 12bfd60 commit 11b34fa

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ container.resolveGroup('group2') // ~ [3, 4], not necessarily in the same order
8585
// up to date. This is useful if we want to use the container as a factory for
8686
// some of your dependencies.
8787
const resolvedContainer = container.resolve('$')
88+
89+
// If you want to indirectly resolve the container itself, it can be done only
90+
// with the methods:
91+
// - resolveConstructor
92+
// - resolveAsyncConstructor
93+
// This is because they have "privileged" information about the container's
94+
// type, while relying on `register` or `registerAsync` plus "combinators" does
95+
// not allow us to leverage that information.
8896
```
8997

9098
It is also possible to register and resolve asynchronous factories and

lambda-ioc/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ container.resolveGroup('group2') // ~ [3, 4], not necessarily in the same order
8585
// up to date. This is useful if we want to use the container as a factory for
8686
// some of your dependencies.
8787
const resolvedContainer = container.resolve('$')
88+
89+
// If you want to indirectly resolve the container itself, it can be done only
90+
// with the methods:
91+
// - resolveConstructor
92+
// - resolveAsyncConstructor
93+
// This is because they have "privileged" information about the container's
94+
// type, while relying on `register` or `registerAsync` plus "combinators" does
95+
// not allow us to leverage that information.
8896
```
8997

9098
It is also possible to register and resolve asynchronous factories and

0 commit comments

Comments
 (0)