Skip to content

Commit cd3daf9

Browse files
authored
Merge pull request #31 from bsitruk/patch-1
Constructor injection simpler
2 parents 450573e + e3601f0 commit cd3daf9

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,9 @@ class WaterFactory {
126126
@Service()
127127
class CoffeeMaker {
128128

129-
private beanFactory: BeanFactory;
130-
private sugarFactory: SugarFactory;
131-
private waterFactory: WaterFactory;
132-
133-
constructor(beanFactory: BeanFactory, sugarFactory: SugarFactory, waterFactory: WaterFactory) {
134-
this.beanFactory = beanFactory;
135-
this.sugarFactory = sugarFactory;
136-
this.waterFactory = waterFactory;
137-
}
129+
constructor(private beanFactory: BeanFactory,
130+
private sugarFactory: SugarFactory,
131+
private waterFactory: WaterFactory) {}
138132

139133
make() {
140134
this.beanFactory.create();

0 commit comments

Comments
 (0)