From cdfd54ed99087dc4a7a3fd13865849ff9ce9e8ba Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 19 May 2019 21:34:08 +0900 Subject: Use TSyringe on background script --- src/background/controllers/SettingController.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/background/controllers/SettingController.ts') 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 { -- cgit v1.2.3