@@ -38,7 +38,6 @@ import { ... } from 'https://deno.land/x/lambda_ioc@[VERSION]/lambda-ioc/deno/in
38
38
``` ts
39
39
import {
40
40
cc2ic , // Stands for "class-constructor to interface-constructor"
41
- constructor ,
42
41
createContainer ,
43
42
func
44
43
} from ' @coderspirit/lambda-ioc'
@@ -64,10 +63,8 @@ const container = createContainer()
64
63
.registerValue (' someName' , ' Timmy' )
65
64
// We can register functions
66
65
.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' )
71
68
// In case we want to register a "concrete" constructor to provide an
72
69
// abstract interface, we'll have to apply a small hack, using `cc2ic`:
73
70
.registerConstructor (' Human' , cc2ic <Human >()(Person ), ' someAge' , ' someName' )
@@ -96,14 +93,6 @@ container.resolveGroup('group2') // ~ [3, 4], not necessarily in the same order
96
93
// up to date. This is useful if we want to use the container as a factory for
97
94
// some of your dependencies.
98
95
const 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.
107
96
```
108
97
109
98
It is also possible to register and resolve asynchronous factories and
0 commit comments