aboutsummaryrefslogtreecommitdiff
path: root/src/background/controllers/SettingController.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-22 20:16:21 +0900
committerGitHub <noreply@github.com>2019-05-22 20:16:21 +0900
commitc1f64927b63d18048790abd3ba907083dbca3084 (patch)
tree3a64b677763f62094c49527d8182f8756a52fbd1 /src/background/controllers/SettingController.ts
parentced89134e32d793d8e091113cfb20867e1c3b572 (diff)
parent7be8bc71784b8dedd0fee03dd72dd8936e2f3929 (diff)
Merge pull request #588 from ueokande/tsyringe
Use tsyringe for DI container
Diffstat (limited to 'src/background/controllers/SettingController.ts')
-rw-r--r--src/background/controllers/SettingController.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/background/controllers/SettingController.ts b/src/background/controllers/SettingController.ts
index dfd2817..34951ff 100644
--- a/src/background/controllers/SettingController.ts
+++ b/src/background/controllers/SettingController.ts
@@ -1,15 +1,14 @@
+import { injectable } from 'tsyringe';
import SettingUseCase from '../usecases/SettingUseCase';
import ContentMessageClient from '../infrastructures/ContentMessageClient';
import Settings from '../../shared/Settings';
+@injectable()
export default class SettingController {
- private settingUseCase: SettingUseCase;
-
- private contentMessageClient: ContentMessageClient;
-
- constructor() {
- this.settingUseCase = new SettingUseCase();
- this.contentMessageClient = new ContentMessageClient();
+ constructor(
+ private settingUseCase: SettingUseCase,
+ private contentMessageClient: ContentMessageClient,
+ ) {
}
getSetting(): Promise<Settings> {