@@ -38,7 +38,6 @@ import { ... } from 'https://deno.land/x/lambda_ioc@[VERSION]/lambda-ioc/deno/in
3838``` ts
3939import {
4040 cc2ic , // Stands for "class-constructor to interface-constructor"
41- constructor ,
4241 createContainer ,
4342 func
4443} from ' @coderspirit/lambda-ioc'
@@ -64,10 +63,8 @@ const container = createContainer()
6463 .registerValue (' someName' , ' Timmy' )
6564 // We can register functions
6665 .register (' fn' , func (printNameAndAge , ' someName' , ' someAge' ))
67- // And constructors too
68- .register (' Person' , constructor (Person , ' someAge' , ' someName' ))
69- // We can do that directly, without having import `constructor`:
70- .registerConstructor (' AnotherPerson' , Person , ' someAge' , ' someName' )
66+ // And constructors too:
67+ .registerConstructor (' Person' , Person , ' someAge' , ' someName' )
7168 // In case we want to register a "concrete" constructor to provide an
7269 // abstract interface, we'll have to apply a small hack, using `cc2ic`:
7370 .registerConstructor (' Human' , cc2ic <Human >()(Person ), ' someAge' , ' someName' )
@@ -96,14 +93,6 @@ container.resolveGroup('group2') // ~ [3, 4], not necessarily in the same order
9693// up to date. This is useful if we want to use the container as a factory for
9794// some of your dependencies.
9895const resolvedContainer = container .resolve (' $' )
99-
100- // If you want to indirectly resolve the container itself, it can be done only
101- // with the methods:
102- // - registerConstructor
103- // - registerAsyncConstructor
104- // This is because they have "privileged" information about the container's
105- // type, while relying on `register` or `registerAsync` plus "combinators" does
106- // not allow us to leverage that information.
10796```
10897
10998It is also possible to register and resolve asynchronous factories and
0 commit comments