-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add default inject init type qualifier
- Loading branch information
Showing
17 changed files
with
304 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ps/same-name-singleton-and-context-proto/app/modules/module-bar/BarConstructorService1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Inject, SingletonProto } from '@eggjs/tegg'; | ||
import { FooService } from '../module-foo/FooService'; | ||
|
||
@SingletonProto() | ||
export class BarConstructorService1 { | ||
constructor( | ||
@Inject() readonly fooService: FooService, | ||
) {} | ||
|
||
type() { | ||
return this.fooService.type; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ps/same-name-singleton-and-context-proto/app/modules/module-bar/BarConstructorService2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Inject, SingletonProto } from '@eggjs/tegg'; | ||
import { FooService } from './FooService'; | ||
|
||
@SingletonProto() | ||
export class BarConstructorService2 { | ||
constructor( | ||
@Inject() readonly fooService: FooService, | ||
) {} | ||
|
||
type() { | ||
return this.fooService.type; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...fixtures/apps/same-name-singleton-and-context-proto/app/modules/module-bar/BarService1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Inject, SingletonProto } from '@eggjs/tegg'; | ||
import { FooService } from '../module-foo/FooService'; | ||
|
||
@SingletonProto() | ||
export class BarService1 { | ||
@Inject() | ||
fooService: FooService; | ||
|
||
type() { | ||
return this.fooService.type; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...fixtures/apps/same-name-singleton-and-context-proto/app/modules/module-bar/BarService2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Inject, SingletonProto } from '@eggjs/tegg'; | ||
import { FooService } from './FooService'; | ||
|
||
@SingletonProto() | ||
export class BarService2 { | ||
@Inject() | ||
fooService: FooService; | ||
|
||
type() { | ||
return this.fooService.type; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
.../fixtures/apps/same-name-singleton-and-context-proto/app/modules/module-bar/FooService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { AccessLevel, ContextProto } from '@eggjs/tegg'; | ||
|
||
@ContextProto({ accessLevel: AccessLevel.PUBLIC }) | ||
export class FooService { | ||
type = 'context'; | ||
} |
6 changes: 6 additions & 0 deletions
6
...t/fixtures/apps/same-name-singleton-and-context-proto/app/modules/module-bar/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "module-a", | ||
"eggModule": { | ||
"name": "a" | ||
} | ||
} |
Oops, something went wrong.